#include <bits/stdc++.h>
using namespace std;
vector<long long> treugol;
long long N;
int main() {
  cin >> N;
  for (long long i = 1; i * (i + 1) / 2 <= 1000000000; i++)
    treugol.push_back(i * (i + 1) / 2);
  for (int i = 0; i < treugol.size() && treugol[i] < N; i++) {
    int j = (lower_bound(treugol.begin(), treugol.end(), N - treugol[i]) -
             treugol.begin());
    if (j >= 0 && j < treugol.size() && treugol[j] + treugol[i] == N) {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
