#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) a[i] = 0;
  if (n == 1)
    cout << "YES\n";
  else {
    long long p = 0, count = 0;
    for (long long i = 0; a[i] <= 0;) {
      if (!a[i]) {
        a[i]++;
        count++;
      }
      i = i + (++p);
      if (i >= n) i = i % n;
    }
    if (count == n)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
