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