#include <bits/stdc++.h>
#define int long long
#define endl '\n'
#define debug(x) cout << '[' << #x << " > " << x << ']' << endl;
using namespace std;

void fastIo(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
}


void solve(){
	int x; cin >> x;
	unordered_map<int, int>mp;
    for(int i=1;i*i*i<=x; i++)
        mp[i*i*i]++;
    int f=0;
    for(int i=1;i*i*i<=x; i++){
        if(mp.find(abs(x-i*i*i))!= mp.end()){
            f=1;
            break;
        }
    }
    if(f==1)
    {
        cout<< "YES"<<endl;
    }else{
         cout<< "NO"<<endl;
    }
}

int32_t main(){
	fastIo();
	int t; cin >> t;
	while(t--)
		solve();
}