#include <bits/stdc++.h>
using namespace std;
const int maxn = 1001;
int n;
bool fr[maxn][maxn];
int use[maxn];
void enter() { scanf("%d", &n); }
void solve() {
  int cnt = n;
  int now = 0, next = 1;
  while (!fr[now][next]) {
    cnt -= 1 - use[now];
    use[now] = 1;
    fr[now][next] = true;
    now += next;
    if (now >= n) now -= n;
    next++;
    if (next > n) next -= n;
  }
  if (cnt == 0)
    printf("YES\n");
  else
    printf("NO\n");
}
int main() {
  enter();
  solve();
  return 0;
}
