#include using namespace std; using ll = long long; ll calc(int x) { ll res = 0; while (x > 0) { res += x; x >>= 1; } return res; } int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; int ok = 0, ng = n + 1; while (ng - ok > 1) { int mid = (ok + ng) / 2; if (calc(mid) <= n) ok = mid; else ng = mid; } cout << (calc(ok) == n ? "YES" : "NO") << endl; return 0; }