#include <bits/stdc++.h>
using namespace std;
int n;
int visit[1005];
bool solve() {
  int k = n * n;
  int g = 1;
  for (int i = 1; i <= n; i++) visit[i] = 0;
  visit[1] = 1;
  int start = 1;
  while (k--) {
    start += g;
    if (start % n == 0)
      start = n;
    else
      start = start % n;
    visit[start] = 1;
    int t = 1;
    for (int i = 1; i <= n; i++) {
      if (visit[i] == 0) {
        t = 0;
        break;
      }
    }
    if (t) return true;
    g++;
  }
  return false;
}
int main() {
  while (cin >> n) {
    if (solve())
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
