#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define int long long
#define pb(x) emplace_back(x)
#define sz(x) static_cast<int> ((x).size())
#define all(x) (x).begin(), (x).end()
#define mp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define vvi vector<vi>
typedef long double ld;
const int infl = 0x3f3f3f3f3f3f3f3fLL;
const int mod = (int)1e9 + 7;

set<int> cubes;

void pre() {
	int i = 1ll;
	while(i * i * i < (int)1e15) {
		cubes.insert(i * i * i);
		i++;
	}
}

void solve() {
	// cout << sz(cubes) << endl;
	int n;
	cin >> n;
	for(auto x: cubes) {
		if(cubes.count(n - x)) {
			cout << "YES\n";
			return;
		}
	}
	cout << "NO\n";
}
	
signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout << fixed << setprecision(20);
	int tt;	tt = 1;
	pre();
	cin >> tt;
	while(tt--){
		solve();
	}
	return 0;
}