#include <bits/stdc++.h>
using namespace std;
int const LIMIT = 100001;
long long a[LIMIT];
int main() {
  int n;
  cin >> n;
  a[0] = 0;
  for (int i = 1; i < LIMIT; i++) a[i] = a[i - 1] + i;
  for (int i = 1; i < LIMIT; i++) {
    if (binary_search(a + 1, a + LIMIT, n - a[i])) {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
