#include <bits/stdc++.h>
using namespace std;
long long n;
map<long long, int> v;
int main() {
  for (long long i = 1; i <= 100000; i++) {
    v[(i * (i + 1)) / (long long)2] = 1;
  }
  int n;
  scanf("%d", &n);
  bool si = 0;
  for (long long i = 1; i * (i + 1) / 2 < n && !si; i++) {
    if (v[n - i * (i + 1) / 2] == 1) {
      si = 1;
    }
  }
  if (si)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
