#include #include #include #include #include #include using namespace std; #define REP(i,n) for(int i=0;i<(n);++i) #define REPS(i,s,t) for(int i=(s);i<(t);++i) #define INF 2000000007 #define MINF -200000007 #define MOD 1048576 // 2^20 #define MAX 1000005 typedef unsigned int uint; typedef unsigned long long int ull; typedef long long int ll; //int dp[MAX]; bool bfs(int tar,ll n){ if(tar == n) return true; else if (tar < n) return false; return bfs(tar-n,n*2)|bfs(tar-n,n*2+1); } int main(){ int N;cin>>N; if(bfs(N,1)) cout << "YES" << endl; else cout << "NO" << endl; return 0; }