#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  while (scanf("%lld", &n) != EOF) {
    long long i, A, B, p = 0;
    for (i = 1; i < sqrt(2 * n); i++) {
      A = i * (i + 1) / 2;
      long long low = i, right = sqrt(2 * n), mid = (low + right) / 2;
      while (low <= right) {
        B = mid * (mid + 1) / 2;
        if (A + B < n) {
          low = mid + 1;
          mid = (low + right) / 2;
        } else if (A + B > n) {
          right = mid - 1;
          mid = (low + right) / 2;
        } else {
          p = 1;
          break;
        }
      }
      if (p == 1) break;
    }
    if (p)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
