#include <bits/stdc++.h>
using namespace std;
template <typename S, typename T>
void fill_(S& buf, const T& x) {
  fill_n(reinterpret_cast<T*>(&buf), sizeof(buf) / sizeof(T), x);
}
template <typename T, int N>
inline int countof(const T (&)[N]) {
  return N;
}
template <typename T>
inline vector<T>& operator+=(vector<T>& ret, const T& x) {
  ret.push_back(x);
  return ret;
}
int N;
int main(int argc, char* argv[]) {
  cin >> N;
  vector<vector<bool>> visited(N, vector<bool>(N, false));
  vector<bool> pos(N, false);
  int now = 0, t = 0;
  while (true) {
    if (visited[now][t]) break;
    visited[now][t] = true;
    pos[now] = true;
    t = (t + 1) % N;
    now = (now + t) % N;
  }
  for (int i = int(0), CNT_i = int(int((pos).size())); i < CNT_i; ++i) {
    if (!pos[i]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
