#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  n *= 2;
  for (int k = 1; k <= sqrt(n); k++) {
    int remain = n - k * (k + 1);
    int r2 = sqrt(remain);
    if (r2 == 0) continue;
    if (r2 * (r2 + 1) == remain || (r2 - 1) * r2 == remain) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
