#include <bits/stdc++.h>
using namespace std;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<pair<int, int> > VPI;
typedef vector<string> VS;
typedef vector<VS> VVS;
bool A[1001];
int main() {
  int N;
  scanf("%d", &N);
  for (int i = 0; i < N; i++) A[i] = 0;
  int pos = 0;
  A[pos] = 1;
  for (int t = 1; t <= N * N; t++) {
    int npos = (pos + t) % N;
    A[npos] = 1;
    pos = npos;
  }
  bool done = true;
  for (int i = 0; i < N && done; i++)
    if (A[i] == 0) done = false;
  printf("%s\n", done ? "YES" : "NO");
  return 0;
}
