#include "bits/stdc++.h" //#include using namespace std; //using namespace atcoder; //#define int long long #define ll long long ll INF = (1LL << 60); constexpr int mod = 1000000007; using P = pair; signed main() { ll a; cin >> a; vectortmp(100020); for (int i = 0; i < 100010; i++) { tmp[i + 1] = tmp[i] + (i + 1); } mapmp; for (int i = 0; i <= 100010; i++) { mp[tmp[i]] = i + 1; } for (int i = 0; i <= 100010; i++) { int idx = mp[tmp[i] + a] - 1; if (idx >= 0) { if (idx - i >= 3) { cout << "YES" << endl; return 0; } } } cout << "NO" << endl; return 0; }