#include <bits/stdc++.h>
int C, N, M[1001];
bool ALL() {
  for (int(x) = (1); (x) <= (N); (x) += (1))
    if (M[x] == 0) return false;
  return true;
}
int main() {
  scanf("%d", &N);
  M[1] = C = 1;
  for (int(x) = (2); (x) <= (N); (x) += (1)) M[x] = 0;
  for (int(x) = (1); (x) <= (2 * N); (x) += (1)) {
    C += x;
    C %= N;
    if (C == 0) C = N;
    M[C] = 1;
  }
  if (ALL())
    printf("YES");
  else
    printf("NO");
}
