#include <bits/stdc++.h>
using namespace std;
const int N = 1003;
bool vis[N];
int main() {
  int n;
  scanf("%d", &n);
  int cur = 0, t = 1;
  while (t < 1000000) {
    vis[cur] = 1;
    cur += t - 1;
    cur %= n;
    ++t;
  }
  int sum = accumulate(vis, vis + n, 0);
  puts(sum == n ? "YES" : "NO");
}
