#include <bits/stdc++.h>
using namespace std;
int n;
bool vis[1001][1001], v[1001];
void flood(int cur, int t) {
  if (t == n) t = 1;
  cur %= n;
  if (vis[cur][t]) return;
  vis[cur][t] = v[cur] = 1;
  flood(cur + t, t + 1);
  return;
}
int main() {
  int i, a;
  scanf("%d", &n);
  if (n == 1) {
    printf("YES\n");
    return 0;
  }
  flood(0, 0);
  a = 1;
  for (i = 0; i < n; i++)
    if (!v[i]) a = 0;
  if (a == 1)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
