#include //#include using namespace std; //using namespace atcoder; using ll = long long; using ull = unsigned long long; using P = pair; #define rep(i,n) for(ll i = 0;i < (ll)n;i++) #define ALL(x) (x).begin(),(x).end() #define MOD 1000000007 int main(){ int a; cin >> a; for(ll i = 3;;i++){ if(i*(i+1)/2 > a)break; for(ll j = 0;j <= i-3;j++){ if((i-j)*(i+j+1)/2 == a){ cout << "YES\n"; return 0; } } } cout << "NO\n"; return 0; }