#include <bits/stdc++.h>
using namespace std;
template <class T>
string toStr(const T &x) {
  stringstream s;
  s << x;
  return s.str();
}
template <class T>
int toInt(const T &x) {
  stringstream s;
  s << x;
  int r;
  s >> r;
  return r;
}
bool mycmp(pair<string, int> a, pair<string, int> b) {
  return (a.second < b.second);
}
vector<pair<string, int> > table;
string convertInt(int number) {
  stringstream ss;
  ss << number;
  return ss.str();
}
int main() {
  int n;
  cin >> n;
  int visit[n];
  memset(visit, 0, sizeof(visit));
  int time = 1000000;
  int i = 0;
  int k = 1;
  while (time--) {
    visit[i] = 1;
    i = (i + k) % n;
    k++;
  }
  int cont = 0;
  for (int i = 0; i < n; ++i)
    if (visit[i] > 0) cont++;
  if (cont == n)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
