#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
void solve() {
  int n;
  cin >> n;
  vector<bool> v(n);
  vector<vector<bool>> temp(n, vector<bool>(n, false));
  v[0] = true;
  int i = 0, j = 1;
  while (true) {
    int k = (i + j) % n;
    if (temp[i][k]) break;
    temp[i][k] = true;
    v[k] = true;
    i = k;
    j++;
  }
  for (int i = 0; i < n; i++) {
    if (v[i])
      continue;
    else {
      cout << "NO" << endl;
      return;
    }
  }
  cout << "YES" << endl;
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
}
