#include <bits/stdc++.h>
using namespace std;
long long N, A, B;
bool fuck(long long x) {
  long long suck = (x << 2ll) + 1ll;
  long long q = sqrt((double)suck);
  return (q * q == suck) && (q & 1ll);
}
int main() {
  scanf("%I64d", &N);
  A = 1;
  N <<= 1;
  bool zhuo = false;
  while (A * (A + 1) < N) {
    long long suck = N - A * (A + 1);
    if (fuck(suck)) {
      zhuo = true;
      break;
    }
    A++;
  }
  if (zhuo)
    printf("YES");
  else
    printf("NO");
  return 0;
}
