#include <bits/stdc++.h>
using namespace std;
const int maxint = -1u >> 2;
const double eps = 1e-6;
int main() {
  int k;
  cin >> k;
  double n = 1.0;
  while (n * n < k) {
    double m = sqrt(2.0 * k - n * (n + 1.0) + 0.25) - 0.5;
    if (ceil(m) == floor(m)) {
      cout << "YES" << endl;
      return 0;
    }
    n += 1.0;
  }
  cout << "NO" << endl;
  return 0;
}
