#include <bits/stdc++.h>
using namespace std;
using ll=long long;
template<typename T>using vc=vector<T>;

constexpr ll N=(ll)1e12+10;
set<ll> CUB;
ll t,n;

int main(){
    CUB.clear();
    for(ll i=1;i*i*i<=N;i++){
        CUB.insert(i*i*i);
    }
    for(scanf("%lld",&t);t--;){
        scanf("%lld",&n);
        ll flag=0;
        for(ll a=1;a*a*a<=n;a++){
            if(CUB.count(n-a*a*a)){
                flag=1;
                break;
            }
        }
        printf(flag?"YES\n":"NO\n");
    }
    return 0;
}
