#include <bits/stdc++.h>
using namespace std;
int main() {
  int num;
  cin >> num;
  for (int i = 1; i <= 2 * sqrt(num); i++) {
    int x = (i * (i + 1)) / 2;
    int tmp = num - x;
    int st = 1, en = 2 * sqrt(num);
    while (st <= en) {
      int mid = st + (en - st) / 2;
      int y = (mid * (mid + 1)) / 2;
      if (y == tmp) {
        cout << "YES" << endl;
        return 0;
      } else if (y < tmp) {
        st = mid + 1;
      } else {
        en = mid - 1;
      }
    }
  }
  cout << "NO" << endl;
}
