#include using namespace std; using i64 = long long; #define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++) i64 N; int main(){ cin >> N; for(int i= 30;i >= 0;i--){ i64 now = (1LL << i) - 1; if(now <= N) N -= now; } if(N == 0){ cout << "YES" << endl; } else{ cout << "NO" << endl; } }