#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#include<bits/stdc++.h>
#define int long long
using namespace std;
typedef pair<int,int> pii;
typedef long long ll;

const int INF = 0x3f3f3f3f;
const double eps = 1e-5;
const int mod = 1e9+7;
const int N = 1e5 + 10;

signed main(){
	IOS
	#ifdef ddgo
		freopen("C:\\Users\\asus\\Desktop\\ddgoin.txt","r",stdin);
    #endif
    
    int tt; cin>>tt;
    while(tt --){
    	int x; cin>>x;
    	bool plas=  false;
    	for(int i=1;i*i*i<=x;i++){
    		int j = x - i*i*i;
    		int k = pow(j,1.0/3);
    		if((k*k*k == j || (k+1)*(k+1)*(k+1) == j) && j){
    			plas = true;
    			break;
			}
		}
		cout<<(plas?"YES":"NO")<<endl;
	}
    
	return 0;
}
