#include using namespace std; int main() { int A; cin >> A; vector sum(1e6 + 1); for (int i = 1; i <= 1e6; i++) { sum[i] = sum[i - 1] + i; } for (int i = 1; i <= 1e6; i++) { long long search = sum[i] - A; auto it = lower_bound(sum.begin(), sum.end(), search); if (it == sum.end()) { continue; } if (*it == search) { int a = it - sum.begin(); if (i - (it - sum.begin()) >= 3) { cout << "YES"; return 0; } } } cout << "NO"; }