#include #define ll long long using namespace std; ll game(ll x) { ll ret = 0; while(x>0) { ret += x; x/=2; } return ret; } int main() { ll n; cin >> n; if(n==0) { cout << "YES" << endl; return 0; } ll ok = 1; ll ng = 10000000001L; while(abs(ok-ng)>1) { ll test = (ok+ng)/2; if(game(test)<=n) { ok = test; } else { ng = test; } } if(game(ok)==n) { cout << "YES" << endl; } else { cout << "NO" << endl; } return 0; }