#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= 2 * sqrt(n) + 100; i++) {
    int x1 = (i * (i + 1)) / 2;
    int tmp = n - x1;
    int s = 1, e = 2 * sqrt(n) + 100;
    while (s <= e) {
      int mid = s + (e - s) / 2;
      int x2 = (mid * (mid + 1)) / 2;
      if (x2 == tmp) {
        cout << "YES\n";
        return 0;
      } else if (x2 < tmp) {
        s = mid + 1;
      } else {
        e = mid - 1;
      }
    }
  }
  cout << "NO\n";
}
