#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  set<int> st;
  set<int>::iterator it;
  for (int i = 1; i <= 45000; ++i) {
    int ans = i * (i + 1) / 2;
    st.insert(ans);
  }
  while (~scanf("%d", &n)) {
    int flag = 0;
    for (it = st.begin(); it != st.end(); ++it) {
      if (st.find(n - *it) != st.end()) {
        flag = 1;
        break;
      }
    }
    if (flag)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
