#include #include using namespace std; string generate(int n); int main() { int n; cin >> n; cout << generate(n) << endl; return 0; } string generate(int n) { int s1 = 0, t1 = 0; do { for(int coin = 0; coin <= 1; coin++) { int s2 = s1, t2 = t1; //1は表 t2 *= 2; if(coin == 1) t2++; s2 += t2; if((coin == 1) || (s2 == n)) { s1 = s2; t1 = t2; break; } } } while((s1 == n) || (s1 > n)); if(s1 == n) return "YES"; else return "NO"; }