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