#include #include #include #include #include #include #include using namespace std; using ll = long long; int main() { int n; cin >> n; int b = 0; if (n <= 1) { b = 1; } else { for (int k = 2; k < 30; k++) { int s = (1 << k) - 1; if (s > n) continue; int t = 1 << (k - 1); if (s == n) b = 1; while (t - 1 > 0) { s += t - 1; if (s > n) { s -= t - 1; } if (s == n) b = 1; t /= 2; } } } cout << (b ? "YES" : "NO") << endl; return 0; }