#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, k = 1, cur = 0;
  vector<int> pl;
  scanf("%d", &N);
  pl.assign(N, 0);
  while (k <= N || !pl[cur]) {
    pl[cur] = 1;
    cur = (cur + k) % N;
    ++k;
  }
  for (int i = 0; i < pl.size(); ++i) {
    if (!pl[i]) {
      printf("NO");
      return 0;
    }
  }
  printf("YES");
  return 0;
}
