#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  cin >> n;
  for (int i = 1; i <= sqrt(2 * n) + 2; i++) {
    double x = 2 * n - i * (i + 1);
    if (x <= 0) continue;
    int y = (sqrt(1 + 4 * x) - 1) / 2;
    if (y * (y + 1) == x && y) {
      printf("YES");
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
