#include <bits/stdc++.h>
using namespace std;
int n;
int arr[1002];
int main() {
  while (scanf("%d", &n) != EOF) {
    memset(arr, -1, sizeof(arr));
    arr[1] = 0;
    int idx = 2, banyak = 1;
    int now = 1, counter = 2;
    while (arr[idx] != now % n && banyak < n) {
      if (arr[idx] == -1) {
        banyak++;
        arr[idx] = now % n;
      }
      now++;
      idx += now;
      while (idx > n) idx -= n;
    }
    if (banyak != n)
      printf("NO\n");
    else
      printf("YES\n");
  }
  return 0;
}
