#include using std::cout; using std::endl; using std::cin; long n; bool check(int t){ long ret = 0; while(t){ ret += t; t >>= 1; } return ret <= n; } long binary(){ long ok = 0, ng = 1e9; while(abs(ok - ng) > 1){ long mid = (ok + ng) / 2; if(check(mid)) ok = mid; else ng = mid; } long ret = 0; while(ok){ ret += ok; ok >>= 1; } return ret == n; } int main(){ cin >> n; if(binary()) cout << "YES" << endl; else cout << "NO" << endl; return 0; }