#include <bits/stdc++.h>
using namespace std;
string check(long long int n) {
  long long int arr[100000], i, j, y = 0;
  arr[0] = 0;
  for (i = 1;; i++) {
    arr[i] = i * (i + 1) / 2;
    if (arr[i] >= n) break;
  }
  j = i;
  for (long long int i = 1; i < j; i++) {
    if (binary_search(arr + 1, arr + j, n - arr[i])) {
      return "YES";
    }
  }
  return "NO";
}
int main() {
  long long int n;
  cin >> n;
  cout << check(n) << endl;
}
