#include<bits/stdc++.h>
#define R register
#define N 100201
#define ll long long

inline bool pdlf(ll x){
	R ll tt=cbrt(x);
	if(tt*tt*tt==x||(tt-1)*(tt-1)*(tt-1)==x||(tt+1)*(tt+1)*(tt+1)==x)
		return 1;
	return 0;
}

inline void solve(){
	R ll x;
	scanf("%lld",&x);
	for(R ll i=1;i<=10000;++i){
		if(i*i*i>=x) break;
		if(pdlf(x-i*i*i)){
			puts("YES");
			return;
		}
	}
	puts("NO");
}

int main(){
	R int T;std::cin>>T;while(T--) solve();
}
