#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(0);
  long long n;
  cin >> n;
  n *= 2;
  for (long long i = 1; i * i <= n; ++i) {
    long long x = n - i * (i + 1);
    long long y = sqrt(x);
    if (y && y * (y + 1) == x) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
