#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, position = 0, i;
  bool arr[1000 + 5], isPossible;
  memset(arr, false, sizeof(arr));
  scanf("%d", &n);
  for (i = 1; i <= n * 2; ++i) {
    position += i;
    position %= n;
    arr[position] = true;
  }
  isPossible = true;
  for (i = 1; i < n; ++i) {
    if (arr[i] == false) {
      isPossible = false;
      break;
    }
  }
  printf("%s\n", isPossible ? "YES" : "NO");
  return (0);
}
