#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> jumps;
  int count, test, total, steps, pos;
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> total;
  pos = steps = 0;
  count = 1;
  jumps.clear();
  jumps.assign(total, 0);
  jumps[0] = 1;
  for (int i = 0; i < 2 * total; i++) {
    steps = (steps + 1) % total;
    pos = (pos + steps) % total;
    if (!jumps[pos]) {
      jumps[pos] = 1;
      count++;
    }
  }
  (count == total) ? cout << "YES\n" : cout << "NO\n";
  return 0;
}
