#include<cstdio>
#include<cmath>
#include<unordered_set>
using namespace std;
typedef long long ll;
const ll N = 1e12;
int main() {
	unordered_set<ll> Cube_table;
	for (ll i = 1; i * i * i <= N; ++i) Cube_table.insert({ i * i * i, 1 });
	int T; scanf("%d", &T);
	while (T--) {
		ll x; scanf("%lld", &x);
		for (ll i = 1; i * i * i < x; ++i) {
			if (Cube_table.find(x-i*i*i) != Cube_table.end()) {
				puts("YES"); goto skip;
			}
		}
		puts("NO");
	skip:;
	}
}