#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  vector<int> a;
  for (long long i = 1; i * (i + 1) / 2 <= 1000000000; ++i)
    a.push_back(i * (i + 1) / 2);
  int n;
  while (cin >> n) {
    string res = "NO";
    for (int i = 0; i < a.size() && a[i] < n; ++i) {
      int k = n - a[i];
      if (*lower_bound((a).begin(), (a).end(), k) == k) {
        res = "YES";
        break;
      }
    }
    cout << res << endl;
  }
  return 0;
}
