#include <bits/stdc++.h>
using namespace std;
int ar[1000], n;
int main() {
  cin >> n;
  int lim = 2000;
  int num = 1;
  memset(ar, false, sizeof(ar));
  ar[0] = true;
  while (lim--) {
    ar[(num * (num + 1) / 2) % n] = true;
    ++num;
  }
  bool ok = true;
  for (int i = 0; i < n; ++i)
    if (!ar[i]) {
      ok = false;
    }
  if (ok)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
