#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T Max(T a, T b) {
  if (a > b)
    return a;
  else
    return b;
}
template <class T>
inline T Min(T a, T b) {
  if (a < b)
    return a;
  else
    return b;
}
template <class T>
inline T gcd(T a, T b) {
  if (a < 0) return gcd(-a, b);
  if (b < 0) return gcd(a, -b);
  return (b == 0) ? a : gcd(b, a % b);
}
template <class T>
inline T lcm(T a, T b) {
  if (a < 0) return lcm(-a, b);
  if (b < 0) return lcm(a, -b);
  return a * (b / gcd(a, b));
}
template <class T>
inline T TripleMax(T a, T b, T c) {
  return Max(Max(a, b), c);
}
template <class T>
inline T TripleMin(T a, T b, T c) {
  return Min(Min(a, b), c);
}
long long n;
long long s;
int solve(long long data) {
  long long ret;
  ret = (long long)sqrt(double(2 * data));
  if (ret * (ret + 1) / 2 == data || ret * (ret - 1) / 2 == data) {
    return 1;
  } else {
    return 0;
  }
}
int main(int argc, const char* argv[]) {
  cin >> n;
  s = (long long)sqrt(double(2 * n));
  for (int i = 1; i < s + 1; i++) {
    if (solve(n - i * (i + 1) / 2) == 1 && n - i * (i + 1) / 2 != 0) {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
