#include <bits/stdc++.h>
using namespace std;
template <class T>
inline int __builtin_popcount(T n) {
  return (n == 0) ? 0 : (1 + __builtin_popcount(n & (n - 1)));
}
int main() {
  int N;
  while (cin >> N) {
    vector<bool> used(N, false);
    for (int i = 0; i < (int)(N); i++) {
      int j = i * (i + 1) / 2;
      used[j % N] = true;
    }
    string res = "YES";
    for (int i = 0; i < (int)(N); i++)
      if (!used[i]) res = "NO";
    cout << res << endl;
  }
  return 0;
}
