#include <bits/stdc++.h>
using namespace std;
int long long Triangular(int a) { return a * (a + 1); }
int main() {
  int long long n, n1, j;
  cin >> n;
  n *= 2;
  for (int i = 1; i * i <= n; i++) {
    n1 = n - Triangular(i);
    j = sqrt(n1);
    if (j > 0 && Triangular(j) == n1) {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
