#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  vector<long long> v;
  cin >> n;
  long long a = 1;
  while (a * (a + 1) / 2 <= n) v.push_back(a * (a + 1) / 2), a++;
  for (long long i = 1; i * (i + 1) / 2 <= n; i++) {
    int cur = n - i * (i + 1) / 2;
    if (binary_search(v.begin(), v.end(), cur)) {
      puts("YES");
      return 0;
    }
  }
  puts("NO");
  return 0;
}
