#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  long long n, flag = 1, c, d, e;
  cin >> n;
  long long j = sqrt(n);
  for (long long i = 1; i <= j; i++) {
    c = (i * (i + 1));
    d = sqrt((2 * n) - c);
    e = d * (d + 1);
    if ((c + e) == 2 * n) {
      flag = 0;
      break;
    }
  }
  if (flag == 0 && n != 1) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
  return 0;
}
