#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T a, T b) {
  return (b == 0) ? abs(a) : gcd(b, a % b);
}
template <typename T>
inline T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <typename T>
inline T mod(T a, T b) {
  return (a % b + b) % b;
}
template <typename T>
inline T sqr(T x) {
  return x * x;
}
template <typename T>
inline string tostring(const T& x) {
  ostringstream os;
  os << x;
  return os.str();
}
inline int toint(const string& s) {
  istringstream is(s);
  int x;
  is >> x;
  return x;
}
inline double todouble(const string& s) {
  istringstream is(s);
  double x;
  is >> x;
  return x;
}
inline string tobinary(int a) {
  string s;
  while (a != 0) {
    s = (char)(a % 2 + '0') + s;
    a >>= 1;
  }
  return s;
}
inline int isvowel(char c) {
  if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u') return 1;
  return 0;
}
inline int isprime(int a) {
  for (int i = 2; i * i <= a; i++)
    if (!(a % i)) return 0;
  return 1;
}
struct debugger {
  template <typename T>
  debugger& operator,(const T& v) {
    cerr << v << " ";
    return *this;
  }
} dbg;
void debugarr(int* arr, int n) {
  cout << "[";
  for (int i = 0; i < n; i++) cout << arr[i] << " ";
  cout << "]" << endl;
}
long long powmod(long long b, long long p, long long m) {
  long long r = 1;
  for (int i = (1 << 30); i; i >>= 1) {
    r *= r;
    r %= m;
    if (p & i) {
      r *= b;
      r %= m;
    }
  }
  return (long long)r;
}
int main() {
  vector<int> tri;
  for (int i = 1; i * (i + 1) <= 2000000000; i++) {
    tri.push_back(i * (i + 1));
  }
  long N;
  cin >> N;
  N = 2 * N;
  for (int i = 0; i < tri.size(); i++) {
    if (binary_search(tri.begin(), tri.end(), N - tri[i])) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
