#include <bits/stdc++.h>
using namespace std;
int n;
int funk[50005], nf;
set<int> second;
int main() {
  for (nf = 1;; ++nf) {
    funk[nf] = nf * (nf + 1) / 2;
    second.insert(funk[nf]);
    if (funk[nf] > 1000000000) break;
  }
  scanf("%d", &n);
  for (int i = 1; i < nf; ++i)
    if (second.count(n - funk[i])) {
      printf("YES\n");
      return 0;
    }
  printf("NO\n");
  return 0;
}
