#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, k;
  cin >> n;
  if (n == 1) {
    cout << "YES";
    return 0;
  }
  int arr[1001] = {0};
  j = 1, i = 1;
  while (1) {
    j = j + i;
    if (j > n) {
      j = j % n;
    }
    arr[j] = 1;
    if ((j == 1) && (i % n == 0)) {
      break;
    }
    i++;
  }
  for (i = 1; i <= n; i++) {
    if (arr[i] == 0) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES";
  return 0;
}
