#include <bits/stdc++.h>
using namespace std;
int main() {
  int f[100000];
  int q = 0;
  int k = 0;
  for (int i = 1; k < 1000000005; i++) {
    k = i * (i + 1) / 2;
    f[q++] = k;
  }
  q--;
  int n;
  while (scanf("%d", &n) != EOF) {
    int flag = 0;
    for (int i = 0; i < q; i++) {
      int l = 0;
      int r = q - 1;
      int mid = (l + r) / 2;
      while (f[mid] + f[i] != n) {
        if (f[mid] > n - f[i])
          r = mid;
        else
          l = mid;
        mid = (l + r) / 2;
        if (r - l <= 1) break;
      }
      if (f[mid] + f[i] == n) {
        flag = 1;
        break;
      }
    }
    if (flag == 0)
      printf("NO\n");
    else
      printf("YES\n");
  }
  return 0;
}
