#include <bits/stdc++.h>
int main() {
  int n;
  int shang;
  int num, cnt;
  int i, j;
  int a[100000];
  while (scanf("%d", &n) != EOF) {
    for (i = 0; i < n; i++) {
      a[i] = 0;
    }
    num = 0;
    cnt = 0;
    a[0] = 1;
    for (i = 0; i < n; i++) {
      for (j = 1; j < n + 1; j++) {
        num = num + j;
        if (num > n) {
          shang = num / n;
          num = num - shang * n;
        }
        a[num] = 1;
      }
    }
    for (i = 0; i < n; i++) {
      cnt = a[i] + cnt;
    }
    if (cnt < n) {
      printf("NO\n");
    }
    if (cnt == n) {
      printf("YES\n");
    }
  }
}
