#include<bits/stdc++.h>
#pragma GCC optimize(2)
#define ll long long
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define per(i,n,a) for(int i=n;i>=a;i--)
#define endl '\n'
#define eps 0.000000001
#define pb push_back
#define mem(a,b) memset(a,b,sizeof(a))
#define IO ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
const int INF=0x3f3f3f3f;
const ll inf=0x3f3f3f3f3f3f3f3f;
const int mod=1e9+7;
const int maxn=1e5+5;
set<ll> s;
int main(){
	rep(i,1,10000) s.insert(1LL*i*i*i);
	int T;scanf("%d",&T);
	while(T--){
		ll n;scanf("%lld",&n);
		int flag=0;
		rep(i,1,10000){
			ll x=1LL*i*i*i;
			ll y=n-x;
			if(s.count(x)&&s.count(y)){
				flag=1;
				break;	
			}
		}
		if(flag) puts("YES");
		else puts("NO");
	}
}
