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