#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    n = 2 * n;
    int mid = (int)sqrt(n * 1.0) + 1;
    bool flg = false;
    for (int i = 1; i <= mid; i++) {
      int t = n - i * (i + 1);
      if (t <= 0) continue;
      int tt = (int)sqrt(t * 1.0) - 1;
      for (int j = 0; j < 3; j++) {
        if (t == (tt + j) * (tt + j + 1)) flg = true;
      }
    }
    if (flg)
      printf("YES\n");
    else {
      printf("NO\n");
    }
  }
  return 0;
}
