#include <bits/stdc++.h>
using namespace std;
const int INF = ~(1 << 31);
const double EPS = 1e-9;
const double PI = 3.141592653589793;
bool dfs(vector<vector<int> >& g, vector<bool>& u, int v) {
  u[v] = 1;
  for (int(i) = 0; (i) < (g[v].size()); (i)++) {
    int to = g[v][i];
    if (u[to])
      return 1;
    else if (dfs(g, u, to))
      return 1;
  }
  return 0;
}
int main() {
  vector<int> a;
  int k = 1;
  while (k * (k + 1) / 2 <= 1e9) {
    a.push_back(k * (k + 1) / 2);
    k++;
  }
  int n;
  cin >> n;
  for (int(i) = 0; (i) < (a.size()); (i)++) {
    for (int j = i; j < a.size(); j++) {
      if (a[i] + a[j] == n) {
        cout << "YES" << endl;
        return 0;
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
