#include <bits/stdc++.h>
using namespace std;
const int N = 222222;
const int mod = 1e9 + 7;
long long n;
int main() {
  cin >> n;
  for (long long i = 1; i * (i + 1) <= n * 2; ++i) {
    long long x = n - (i * (i + 1) / 2);
    long long t = sqrt(x * 2);
    for (long long j = t - 10; j <= t + 10; ++j)
      if (j > 0 && j * (j + 1) == x * 2) return cout << "YES", 0;
  }
  cout << "NO";
  return 0;
}
