#include <bits/stdc++.h>
using namespace std;
int main() {
  bool a[1000];
  long n, i, j, k;
  cin >> n;
  for (i = 0; i < 1000; i++) {
    a[i] = 0;
  }
  a[0] = 1;
  i = 0;
  for (k = 1; k < 1000000; k++) {
    i = (i + k) % n;
    a[i] = 1;
  }
  for (i = 0; i < n; i++) {
    if (!a[i]) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES";
  return 0;
}
