#include <bits/stdc++.h>
using namespace std;
bool y[3000];
int main() {
  int n;
  cin >> n;
  int now = 1;
  y[1] = 1;
  for (int i = 1; i <= 2 * n; i++) {
    now += i;
    now = now % n;
    y[now] = 1;
  }
  for (int i = 0; i < n; i++) {
    if (y[i] == 0) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
