#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> v(44722);
  for (int i = 0; i < v.size(); ++i) v[i] = (i + 1) * (i + 2) / 2;
  for (int i = 0; i < v.size(); ++i) {
    if (v[i] > n) break;
    if (binary_search(v.begin(), v.end(), (n - v[i]))) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
