#include <bits/stdc++.h>
using namespace std;
int main() {
  long long y, n, i, a, st, nok, x, d;
  cin >> n;
  i = 1;
  for (i = 1;; i++) {
    x = i * (i + 1) / 2;
    y = (n - x) * 2;
    d = (long long)sqrt((double)y);
    if (d < i) break;
    if (x + (long long)d * (d + 1) / 2 == n) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
