#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j;
  cin >> n;
  vector<int> v(n, 0);
  for (i = 0, j = 0; i < 2 * n; i++) {
    v[j] = 1;
    j = (j + i) % n;
  }
  for (i = 0; i < n; i++) {
    if (!v[i]) break;
  }
  cout << (i == n ? "YES" : "NO");
}
