#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using namespace std;
int a[1005];
int main() {
  int n, p = 0, q = 1;
  cin >> n;
  if (n == 1) {
    cout << "YES";
    return 0;
  }
  a[0] = 1;
  for (int i = 2; i <= 1000000; i++) {
    if (a[(p + i - 1) % n] == 0) q++;
    a[(p + i - 1) % n]++;
    p = (p + i - 1) % n;
    if (q == n) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
