#include<bits/stdc++.h>
using namespace std;

int main(){
    long long int t;
    cin>>t;
    while(t--){
        long long int x,a=1,b,res;
        cin>>x;
        bool flag = false;
        while(a*a*a < x && !flag){
            res = cbrt(x - a*a*a);
            
            if(res-cbrt(x - a*a*a) == 0)
                flag = true;
                
            a++;    
        }
        if(flag)
            cout<<"YES"<<endl;
            
        else
            cout<<"NO"<<endl;
    }
    return 0;
}