#include<bits/stdc++.h>
using namespace std;
int main(){
	int t;
	cin>>t;
	while(t--){
		long long n;
		cin>>n;
		int f=0;
		for(int i=1;i<=10000;i++){
			long long temp=i*i;
			temp*=i;
			long long guess=n-temp;
			long long mid,kk;
			long long low=1;
			long long high=10000;
			if(!guess) break;
			while(low<=high&&guess){
				mid=(low+high)/2;
				kk=mid*mid;
				kk*=mid;
				if(guess==kk){
					f=1;
					break;
				}
				if(guess>kk){
					low=mid+1;
				}
				if(guess<kk){
					high=mid-1;
				}
			}
			if(f){
				cout<<"YES"<<endl;
				break;
			}
		}
		if(!f) cout<<"NO"<<endl;
	}
	return 0;
}
