#include <bits/stdc++.h>
using namespace std;
unsigned long long a, b, c;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> a;
  if (a == 1) {
    cout << "NO" << endl;
    return 0;
  }
  for (int i = 1; i <= 31622; i++) {
    b = a;
    if (b < i * (i + 1) / 2) {
      break;
    }
    b -= (i * (i + 1)) / 2;
    c = sqrt(8 * b + 1);
    if (c * c == 8 * b + 1 && c != 1) {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
