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

typedef long long ll;

std::vector<ll> fi;
set<ll>fis;

int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
        
    for (ll i = 1; i * i * i <= 1000000000005; i++) {
        fis.insert(i * i * i);
        fi.push_back(i * i * i);
    }
    
    ll t;
    cin>>t;
    while(t--){
        ll n;
        cin>>n;
        bool res = false;
        for(int i=0 ;  i<fi.size(); i++) {
            if (fis.find(n - fi[i]) != fis.end()) {
                cout << "YES" << endl;
                res = true;
                break;
            }
        }
        if(!res){
            cout << "NO" << endl;
        }
    }
    
    
return 0;
}
