#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long p;
  long long q;
  long long r;
  long long s;
  double t;
  int ans = 0;
  if (n == 1) {
    cout << "NO" << endl;
    return 0;
  }
  for (long long i = 1; i <= sqrt(n); i++) {
    p = (i * (i + 1)) / 2;
    q = n - p;
    r = (8 * q) + 1;
    s = sqrt(r);
    t = sqrt((double)r);
    if (s == t) {
      ans = 1;
      break;
    }
  }
  if (ans == 1) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
