#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> t;
int main() {
  cin >> n;
  for (int i = 1; i * (i + 1) / 2 < 1000000000; ++i) {
    t.push_back(i * (i + 1) / 2);
  }
  int sz = t.size();
  for (int i = 0; i < sz && t[i] < n; ++i) {
    for (int j = i; j < sz && t[j] < n; ++j) {
      if (t[i] + t[j] == n) {
        cout << "YES" << endl;
        return 0;
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
