#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000 + 10;
int n;
bool vis[MAXN][MAXN];
bool ov[MAXN];
int main() {
  cin >> n;
  int nw = 0, m = 1;
  while (!vis[nw][m]) {
    vis[nw][m] = true;
    ov[nw] = true;
    (nw += m) %= n;
    (++m) %= n;
  }
  for (int i = 0; i < n; i++)
    if (!ov[i]) {
      puts("NO");
      return 0;
    }
  puts("YES");
  return 0;
}
