#include <bits/stdc++.h>
using namespace std;
int main() {
  int arr[1005], p = 0, n;
  arr[0] = 1;
  scanf("%d", &n);
  memset(arr, 0, sizeof(arr));
  for (int i = 1; i <= n; ++i) {
    p += (i - 1);
    p %= n;
    arr[p] = 1;
  }
  bool done = 1;
  for (int i = 0; i < n; ++i)
    if (!arr[i]) done = 0;
  if (done)
    puts("YES");
  else
    puts("NO");
  return 0;
}
