#include <bits/stdc++.h>
using namespace std;
map<signed long long int, int> mp;
int main() {
  signed long long int n;
  cin >> n;
  for (int i = 1; i * (i + 1) / 2 <= n; ++i) mp[i * (i + 1) / 2] = 1;
  for (int i = 1; i * (i + 1) / 2 <= n; ++i) {
    signed long long int b1 = i * (i + 1) / 2;
    signed long long int b2 = n - b1;
    if (mp[b2]) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
}
