#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
map<ll,ll>mp;
void excel()
{
	for(ll i=1;i<=10000;i++)
	  mp[i*i*i]=1;
}
void solve()
{
	ll x,a,b;
	cin>>x;
	for(ll i=1;i<=10000;i++)
	{
		if(mp[x-i*i*i]==1)  
		{
			cout<<"YES"<<endl;
			return;
		}
	}
	cout<<"NO"<<endl;
	return;
}
int main()
{
    ll t;
    cin>>t;
    excel();
    while(t--)  solve();
    return 0;
}