#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll t,n;
map<ll,ll> a;
void power()
{
for (ll i=0; i<=1000000; i++)
{
ll k=i*i*i;
a[k]=1;
}
}
void dealwithme()
{
cin>>t; power();
while (t--)
{
cin>>n;
if (a[n]==1) cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
}
int main()
{
freopen("cc.inp","r",stdin);
freopen("cc.out","w",stdout);
dealwithme();
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgbGwgbG9uZyBsb25nCmxsIHQsbjsKbWFwPGxsLGxsPiBhOwp2b2lkIHBvd2VyKCkKewogICAgZm9yIChsbCBpPTA7IGk8PTEwMDAwMDA7IGkrKykKICAgIHsKICAgICAgICBsbCBrPWkqaSppOwogICAgICAgIGFba109MTsKICAgIH0KfQp2b2lkIGRlYWx3aXRobWUoKQp7CiAgICBjaW4+PnQ7IHBvd2VyKCk7CiAgICB3aGlsZSAodC0tKQogICAgewogICAgICAgIGNpbj4+bjsKICAgICAgICBpZiAoYVtuXT09MSkgY291dDw8IllFUyI8PGVuZGw7CiAgICAgICAgZWxzZSBjb3V0PDwiTk8iPDxlbmRsOwogICAgfQp9CmludCBtYWluKCkKewogICAgZnJlb3BlbigiY2MuaW5wIiwiciIsc3RkaW4pOwogICAgZnJlb3BlbigiY2Mub3V0IiwidyIsc3Rkb3V0KTsKICAgIGRlYWx3aXRobWUoKTsKfQ==