#include <bits/stdc++.h>
using namespace std;
bool v[1010];
bool vt[1010][1010];
int visited;
int p, t, n;
int main() {
  scanf("%d", &n);
  memset(v, 0, sizeof(v));
  memset(vt, 0, sizeof(vt));
  p = 0;
  t = 1;
  visited = 1;
  v[p] = 1;
  vt[p][t] = 1;
  do {
    p = (p + t) % n;
    if (!v[p]) {
      v[p] = 1;
      visited++;
    }
    t = (t + 1) % n;
    if (visited == n) break;
  } while (!vt[p][t]);
  if (visited == n)
    printf("YES\n");
  else
    printf("NO\n");
}
