#include #define ll long long using namespace std; bool dfs(const ll t, const ll s, const ll n) { // printf("dfs(%lld, %lld, %lld\n", t, s, n); if(s==n) return true; if(s>n) return false; ll next1 = 2*t; ll next2 = next1+1; return dfs(next1,s+next1, n) || dfs(next2, s+next2, n); } int main() { ll n; cin >> n; if(n == 0 || dfs(1, 1, n)) { cout << "YES" << endl; } else { cout << "NO" << endl; } return 0; }