#include<bits/stdc++.h>
#define int long long
using namespace std;
bool find(int x){
for(int a=1;a*a*a<=x;a++){
int ck=x-a*a*a;
if(ck<0){
continue;
}
int l=1,r=cbrt(ck);
while(l<=r){
int mid=(l+r)/2;
int cb=mid*mid*mid;
if(cb==ck){
return 1;
}
else if(cb<ck){
l=mid+1;
}
else{
r=mid-1;
}
}
}
return 0;
}
signed main(){
int t,k;
cin>>t;
for(int i=1;i<=t;i++){
cin>>k;
if(!find(k)){
cout<<"NO"<<endl;
}
else{
cout<<"YES"<<endl;
}
}
return 0;
}
WA70,help!