#include <bits/stdc++.h>
using namespace std;
bool triangular(long long n) {
  long long sq = 1 + ((long long)(sqrtl(1 + 8 * n) + 1e-6)) / 2;
  return ((((sq) * ((sq) + 1)) / 2) == n ||
          (((sq - 1) * ((sq - 1) + 1)) / 2) == n ||
          (((sq + 1) * ((sq + 1) + 1)) / 2) == n);
}
int main() {
  long long n;
  while (cin >> n) {
    bool is = false;
    for (long long i = 1; (((i) * ((i) + 1)) / 2) < n; ++i) {
      if (triangular(n - (((i) * ((i) + 1)) / 2))) {
        is = true;
        break;
      }
    }
    cout << (is ? "YES" : "NO") << endl;
  }
  return 0;
}
