#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<int, bool> b;
  for (int i = 1, c = 1; i < 100000; i++) {
    c = (c + i % n - 1) % n + 1;
    b[c] = 1;
  }
  cout << (b.size() == n ? "YES" : "NO") << endl;
  return 0;
}
