#include <bits/stdc++.h>
using namespace std;
void prepare() {}
const int MAXN = 1010;
bool a[MAXN];
set<pair<int, int> > e;
pair<int, int> q;
bool solve() {
  memset(a, false, sizeof(a));
  e.clear();
  int n, k = 1, x = 0, res;
  scanf("%d", &n);
  e.insert(make_pair(x, k));
  a[0] = true;
  res = n - 1;
  while (true) {
    x = (x + k) % n;
    k = (k + 1) % n;
    if (!a[x]) res--;
    if (res <= 0) return true;
    a[x] = true;
    q = make_pair(x, k);
    if (e.find(q) != e.end()) break;
    e.insert(q);
  }
  return false;
}
int main() {
  prepare();
  printf(solve() ? "YES\n" : "NO\n");
  return 0;
}
