#include <bits/stdc++.h>
int main() {
  int p[1005];
  long n, i, k, pos, count;
  while (scanf("%ld", &n) == 1) {
    for (i = 0; i < n; i++) p[i] = -1;
    k = 0, pos = 0;
    count = n;
    while (1) {
      k %= n;
      pos += k;
      pos %= n;
      if (p[pos] == -1) {
        count--;
        if (count == 0) {
          printf("YES\n");
          break;
        }
        p[pos] = k;
      } else if (p[pos] == k) {
        printf("NO\n");
        break;
      }
      if (k == n) k = 0;
      k++;
    }
  }
  return 0;
}
