#include <bits/stdc++.h>
using namespace std;
int n, i, j, a[1005], x = 1;
int main() {
  cin >> n;
  a[0] = 1;
  for (i = 0; i <= 100000; ++i) {
    j = (i + j) % n + 1;
    if (!a[j - 1]) {
      a[j - 1]++;
      x++;
    }
    if (x == n) break;
  }
  if (x == n)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
