#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  for (long long int i = 1; i * (i + 1) <= 2 * n; i++)
    for (long long int j = i; j * (j + 1) <= 2 * n; j++)
      if (i * (i + 1) + j * (j + 1) == 2 * n) {
        cout << "YES" << endl;
        return 0;
      }
  cout << "NO" << endl;
  return 0;
}
