#include <bits/stdc++.h>
using namespace std;
int n, p;
int main() {
  map<int, int> mp;
  cin >> n;
  for (int i = 1; i <= 2 * n + 1; i++) {
    if (p % n == 0) {
      mp[n]++;
    }
    mp[p % n]++;
    p += i - 1;
  }
  for (int i = 1; i <= n; i++) {
    if (mp[i] == 0) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES"
       << "\n";
  return 0;
}
