#include <bits/stdc++.h>
using namespace std;
int ajuns[1001], drum[1001][1001];
int main() {
  int n;
  cin >> n;
  ajuns[0] = true;
  int jump = 1, ramane = n - 1;
  int pp = true, h = 0;
  while (ramane && pp) {
    int init = h;
    h += jump;
    h %= n;
    if (!ajuns[h]) --ramane;
    ajuns[h] = true;
    if (drum[init][jump])
      pp = 0;
    else
      drum[init][jump] = true;
    jump++;
    if (jump == n + 1) jump = 1;
  }
  if (ramane == 0)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
