//Created by Hemant Raj
#include<bits/stdc++.h>
#include <iomanip>
#include<algorithm>
#include<vector>
#include<string>
#include <unordered_map> 
#include<set>
using namespace std; 

typedef long long int ll; 
typedef vector<int> vi;
typedef vector<vector<int>> vvi; 
typedef pair<int, int> pi; 
typedef vector<pair<int,int>> vpi;
typedef vector<pair<int,int>> vpl;


#define max(a, b) (a < b ? b : a) 
#define min(a, b) ((a > b) ? b : a) 
#define mod 1e18 + 7 
#define INF 1000000000000000003 

#define lb                   lower_bound
#define ub                   upper_bound
#define mine                *min_element
#define maxe                *max_element
#define pb   push_back
#define POB pop_back 
#define MP make_pair 

#define F                    first
#define S                    second
#define ceil(x,a)             ((x + a - 1)/(a))
#define all(v)               v.begin(), v.end()
#define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
 
#define read_ar(ar, n,k)           for (int ele = k; ele < n+k; ele++)cin>>ar[ele];
#define print_ar(ar, n,k)          for (int ele = k; ele < n+k; ele++)cout<<ar[ele]<<" ";

bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {return (a.second < b.second);}
//Prime_Seive
bool prime[1000000+1]; void seive(){ ll N=1e6+1; memset(prime,true,sizeof(prime)); prime[0]=false; prime[1]=false; for(ll i=2;i*i<=N;i++){ if(prime[i]){ for(ll j=i*i;j<=N;j+=i){ prime[j]=false;}}}}
// check whether the given number is pow of 2
bool isPowerOfTwo(int x) {return (x && !(x & (x - 1)));}

bool is_prime(int n){
  if(n<=1)
    return false;
  if(n<=3)
    return true;
  if(n%2==0||n%3==0)
    return false;
  for(int i=5;i*i<=n;i=i+6)
    if (n%i==0||n%(i+2)==0)
      return false;
  return true;
}


// DFS
/*
int const G=100000;
int vist[G];
vector<int> edge[G];

void DFS(int sv){
  vist[sv]=1;
  for(int i=0;i<edge[sv].size();i++){
       if(vist[edge[sv][i]]==0){
       DFS(edge[sv][i]);
     }
  }
}
*/
// BIPARTIDE TEST

/*
int clr[G];
bool BPTT(int v,int c){
    vist[v]=1;
    clr[v]=c;
    for(auto child:edge[v]){

      if(vist[child]==0){
        if(BPTT(child,1^c)==false)
          return false;
      }
      else{
          if(clr[v]==clr[child]){
            return false;
          }
      }
   }
   return true;

}
int cnt=1;


*/
/*
ll bfs(int sv){
  queue<int>pn;
  pn.push(sv);
  vst[sv]=1;
  ll temp=ar[sv];
  while(!pn.empty()){
    int x=pn.front();
     vst[x]=1;
    pn.pop();
    for(int i=0;i<edge[x].size();i++){
      if(!vst[edge[x][i]]){
      pn.push(edge[x][i]);
      temp=min(temp,ar[edge[x][i]]);
    }
    }
  }
  //cout<<temp<<" ";
  return temp;
}
*/


////////////  In_Out_Timer ////////////////
/*
int timer=1;
int const N=100005;
vector<int> edge[N];
int vist[N];
int In[N];
int Out[N];
void In_Out_DFS(int v){
  vist[v]=1;
  In[v]=timer++;

  for(auto chd: edge[v]){
    if(vist[chd]==0){
      In_Out_DFS(chd);
    }
  }
  Out[v]=timer++;
}

*/
  
   /////// Cycle Detection in Graph ///////////
/*
int const N=100005;
vector<int> edge[N];
int vist[N];
bool Cycle_DFS(int node,int par){

   vist[node]=1;

  for(auto child : edge[node]){
    if(vist[child]==0){

      if(Cycle_DFS(child,node)==true)return true;
    }
    else{
      if(child!=par){
        return true;
      }
    }
  }
  return false;


}
*/





void hemant(){

 int n; cin>>n;
 ll ar[n];
 read_ar(ar,n,0);
  ll ans=0;

  
  for(int i=0;i<n-1;){
   ll x=ar[i];
   ll y=ar[i+1];
   ll mm=min(x,y);
   ll mx=max(x,y);
   while(mx>(2*mm)){
    
    
    ans++;
    mm*=2;
   }
   



  }

cout<<ans<<"\n";


}









int main(){
    #ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input_hemant.txt", "r", stdin);
    // for writing output to output.txt
    freopen("hemant_output.txt", "w", stdout);
#endif
      
     fast_io;
      
    int t; cin>>t;

  ll cube[10001];
  //unordered_map<ll,int>
  set<ll>chk;
  for(ll i=1;i<=10000;i++){
    cube[i]=(i*i*i);
    //chk[cube[i]]++;
    chk.insert(cube[i]);

  }


    while(t--){
     ll num; cin>>num;
     int f=0;
    for(int i=1;i<=10000;i++){
    ll x=num-cube[i];
    if(x<=0)break;
    if(chk.count(x)){
      f=1;
      break;
    }

  }

  if(f)cout<<"YES"<<"\n";
  else cout<<"NO"<<"\n";
    }
    return 0;
}
