#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> V;
  set<int> S;
  for (int k = 1, x; (x = (k * (k + 1)) / 2) <= 1000000000; k++) {
    V.push_back(x);
    S.insert(x);
  }
  int n;
  cin >> n;
  for (int i = 0; i < V.size() && V[i] < n; i++)
    if (S.find(n - V[i]) != S.end()) {
      cout << "YES";
      return (0);
    }
  cout << "NO";
  return (0);
}
