#include <bits/stdc++.h>
using namespace std;
int used[1010];
int N;
int main() {
  scanf("%d", &N);
  memset(used, 0, sizeof(used));
  used[1] = 1;
  int cpoz = 1;
  for (int i = 1; i <= 2000; ++i) {
    cpoz += i;
    cpoz %= N;
    if (cpoz == 0) cpoz = N;
    used[cpoz] = 1;
  }
  bool ok = true;
  for (int i = 1; i <= N; ++i)
    if (used[i] == 0) ok = false;
  if (ok)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
