#include <iostream>
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;

int main()
{   
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    int t=1;
    cin>>t;
    while(t--)
    {
       ll n;int f=0;
        cin>>n;
        if(n==1)
        {
            cout<<"NO";
        }
        else{
        ll k=cbrt(n);
        for(ll i=1;i<=k;i++){
            ll a=i*i*i;
            ll b1=n-a;
           
            ll b=cbrt(b1);
            if(b*b*b==b1 && b1!=0){
                f=1;
                break;
            }
            
                
        }
        
        if(f==1) cout<<"YES";
        else cout<<"NO";
        }
        cout<<endl;
        
    }

    return 0;
}
