#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  set<long long> tr;
  for (long long m = 1; m * (m + 1) / 2 <= n; m++) {
    tr.insert(m * (m + 1) / 2);
  }
  set<long long>::const_iterator it;
  for (it = tr.begin(); it != tr.end(); it++) {
    if (tr.find(n - (*it)) != tr.end()) {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
