#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, n, h, A, B, tar = 0;
  scanf("%lld", &n);
  for (int i = 1; i < sqrt(double(2 * n)); i++) {
    A = (i * (i + 1)) / 2;
    ;
    long long l = i, r = sqrt(double(2 * n)), mid = (l + r) / 2;
    while (l <= r) {
      B = mid * (mid + 1) / 2;
      if (A + B == n) {
        tar = 1;
        goto aaa;
      } else if (A + B < n) {
        l = mid + 1;
        mid = (l + r) / 2;
      } else {
        r = mid - 1;
        mid = (l + r) / 2;
      }
    }
  }
aaa:
  if (tar == 0)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
}
