#include <bits/stdc++.h>
using namespace std;
int N;
int main() {
  cin >> N;
  int j = 1;
  while (j * (j + 1) / 2 < N) j++;
  for (int i = 1; i * (i + 1) / 2 < N; i++) {
    while (i * (i + 1) / 2 + j * (j + 1) / 2 > N) j--;
    if (i * (i + 1) / 2 + j * (j + 1) / 2 == N) {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
