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