A flea is sitting at one of the *n* hassocks, arranged in a circle, at the moment. After minute number *k* the flea jumps through *k* - 1 hassoсks (clockwise). For example, after the first minute the flea jumps to the neighboring hassock. You should answer: will the flea visit all the hassocks or not. We assume that flea has infinitely much time for this jumping.
The only line contains single integer: 1 ≤ *n* ≤ 1000 — number of hassocks.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1000000009;
const ll maxn = 4e5 + 5;
vector<ll> arr, brr, crr;
void solve();

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(nullptr);
	cout.tie(nullptr);
	cout.precision(10);
	cout << fixed;

#ifdef LOCAL
	freopen("in.txt", "r", stdin);
	// freopen("out.txt", "w", stdout);
#endif

	// freopen("input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);

	solve();

#ifdef LOCAL
	cerr << endl;
	cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
	return 0;
}

void solve()
{
	int n;
	cin >> n;
	vector<vector<int>> vis(n, vector<int>(n, 0));
	vector<int> vp(n, 0);
	int cnt = 0;
	int k = 1;
	int s = 0;
	while (cnt < n)
	{
		if (vis[s][k] == 1)
			break;
		vis[s][k] = 1;
		if (vp[s] == 0)
		{
			cnt += 1;
			vp[s] = 1;
		}

		s += k;
		s %= n;
		k = (k + 1) % n;
	}
	if (cnt == n)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
}