#include <bits/stdc++.h>
bool bloh[2000];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1, k = 0; i < 3000000; i++) {
    bloh[k] = true;
    k += i;
    k %= n;
  }
  for (int i = 0; i < n; i++) {
    if (bloh[i] == false) {
      printf("NO\n");
      return 0;
    }
  }
  printf("YES\n");
  return 0;
}
