#include <bits/stdc++.h>
using namespace std;
int INF = 1e9;
int const N = 5e4 + 16;
int const M = 1e9 + 7;
int const M2 = 999999983;
int n;
int main() {
  scanf("%d", &n);
  bool found = false;
  for (int i = 1; i < 44722; ++i) {
    long long t1 = i * (i + 1) / 2;
    if (t1 > n) break;
    int l = i + 1, r = 44722;
    while (l < r) {
      int m = (l + r) / 2;
      int t2 = m * (m + 1) / 2;
      if (t1 + t2 <= n)
        l = m + 1;
      else
        r = m;
    }
    if (t1 + l * (l - 1) / 2 == n || n == t1 + t1) {
      found = true;
      break;
    }
  }
  puts(found ? "YES" : "NO");
}
