#include <bits/stdc++.h>
#define int long long

using namespace std;

set<long long> ts;

void solve() {
	long long x;
	cin >> x;
	for (long long a = 1; a <= 10000; a++) {
		if (ts.count(x - a*a*a)) {
			cout << "YES\n";
			return;
		}
	}
	cout << "NO\n";
}

signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t;
	for (long long a = 1; a <= 10000; a++) {
		ts.insert(a * a * a);
	}
	cin >> t;
	for (;t--;) {
		solve();
	}
}
