#include <bits/stdc++.h>

using namespace std;

#define int long long int 
#define pb push_back
#define pii pair<int,int>
#define mkp make_pair
#define ff first
#define ss second

int bns(int l , int  r , int n){
    if(l<=r){
        int mid = ((l+r)>>1) ;
        if(mid*mid*mid > n) r = mid - 1 ;
        else if(mid*mid*mid < n) l = mid + 1 ;
        else return 1 ;
        return bns(l , r , n) ;
    }
    else return 0 ;
}

void solve(){
    int n  ;
    cin >> n ;
    for(int i = 1 ; i <= 1e4 and i*i*i < n ; i++){
        int ans = bns(1 , 1e4 , n - (i*i*i)) ;
        if(ans){
            cout << "YES" << endl ;
            return ;
        }
    }
    cout << "NO" << endl ;
}

int32_t main() {
    int t = 1 ;
    scanf("%lld",&t) ;
    while(t--) solve() ;
	return 0 ;
}


