/**-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*                                                               *-*
*-*                  Bismillahir Rahmanir Rahim                   *-*
*-*          Allah is the greatest && Allah is everlasting        *-*
*-*                  Author: Ahsan Habib (comrade)                *-*
*-*                    Metropolitan University                    *-*
*-*                         Language: C++                         *-*
*-*                                                               *-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**/
#include<bits/stdc++.h>
#include<cstdio>
#define pii          pair<ll,ll >
#define In freopen("ahsan.txt","r",stdin);
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define bug(a) cerr << #a << " : " << a << endl
#define   sz(x)       x.size()
#define MOD 1000000007
#define inf 999999999999
using namespace std;
vector<ll>a;
int main()
{

    ios::sync_with_stdio(0);
    cin.tie(0);
   //In;
    int t;
    set<ll>s;
    scanf("%d",&t);
    for(ll i = 1; i*i*i<=1000000000000; i++)
    {
        s.insert(i*i*i);
        // cout<<"YES"<<endl;
    }

    while(t--)
    {
        ll n;
        scanf("%lld",&n);
        ll f = 0;
        for(auto i : s)
        {
            if(i>n)break;
            ll x = n - i;
            if(s.find(x)!=s.end())
            {
                f = 1;
                break;
            }
        }
        if(f)cout<<"YES"<<endl;
        else cout<<"NO"<<endl;

        //break;
    }
    return 0;
}
