#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		ll n;
		cin>>n;
		ll x=10000;
		ll y=1;
		int flag=0;
		while(x>=y)
		{
			if(((x*x)*x)+((y*y)*y)<n)
			{
				y++;
			}
			else if(((x*x)*x)+((y*y)*y)>n)
			{
				x--;
			}
			else
			{
			flag=1;
			break;
		}
		}
		if(flag==0)
		{
			cout<<"NO"<<endl;
		}
		else
		cout<<"YES"<<endl;
	}
	return 0;
}
