#include <bits/stdc++.h>
using namespace std;
template <typename T>
string tostr(const T& t) {
  ostringstream os;
  os << t;
  return os.str();
}
long long big = 10000000;
int main() {
  int N;
  cin >> N;
  int at = 0;
  vector<bool> vis(N, false);
  for (int k = (int)(0); k <= (int)(1010 - 1); ++k) {
    vis[(at + k) % N] = true;
    at = (at + k) % N;
  }
  bool ok = true;
  for (int i = (int)(0); i <= (int)(N - 1); ++i) {
    if (!vis[i]) {
      ok = false;
      break;
    }
  }
  cout << (ok ? "YES" : "NO") << endl;
  return 0;
}
