#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define INF LLONG_MAX/5 #define MOD 1000000007 #define pi 3.14159265358979 #define int long long #define rep(i, n) for (int i = 0; i < n; i++) #define sort(v) sort((v).begin(), (v).end()) #define reverse(v) reverse((v).begin(), (v).end()) #define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge) #define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge) #define enld endl void vout(vectorA) { rep(i, A.size()) { cout << A[i]; if (i == A.size() - 1) { cout << endl; } else { cout << ' '; } } } void vvout(vector>A) { rep(i, A.size()) { rep(j, A[i].size()) { cout << A[i][j]; if (j == A[i].size() - 1) { cout << endl; } else { cout << ' '; } } } } signed main() { int A; cin >> A; for (int N = 3; N < 1000000; N++) { if ((A - N * (N + 1) / 2) % N == 0) { cout << "YES" << enld; return 0; } } cout << "NO" << endl; }