#include <bits/stdc++.h>
using namespace std;
const int dx[4] = {1, 1, 0, 0};
const int dy[4] = {0, 0, 1, 1};
int jump(int n, int pos, int k) { return ((pos + k) % n); }
int main(int argc, char* argv[]) {
  set<int> jumps;
  set<int>::iterator it;
  bool repeat = true;
  int n;
  cin >> n;
  jumps.insert(0);
  int jmp = jump(n, 0, 1);
  jumps.insert(jmp);
  int max_sz = (n * n) / 2 + 20;
  for (int i = 2; i < max_sz; i++) {
    jmp = jump(n, jmp, i);
    jumps.insert(jmp);
    if (jumps.size() == n) {
      repeat = false;
      break;
    }
  }
  if (repeat)
    cout << "NO";
  else
    cout << "YES";
  return 0;
}
