#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int binary_search( long long int *a,long long int n,long long int key ){
    long long int mid, front=0, back=n-1;
    while (front<=back){
        mid = front+(back-front)/2;//防止加和后溢出
        if (a[mid]==key)
            return 1;
        if (a[mid]<key)
            front = mid+1;
        else
            back = mid-1;
        }
    return 0;
    }

int main()
{
    int t;
    long long int mi[10005];
    scanf("%d",&t);
    for(long long int i=1;i<=10004;i++)
        mi[i]=i*i*i;
    for(int i=1;i<=t;i++)
    {
        long long int x;
        int flag=0;
        scanf("%lld",&x);
        for(int j=10001;j>=1;j--)
        {
            if(binary_search(mi+1,10001,x-mi[j]))
            {
                flag=1;
                break;
            }
        }
        if(flag==1)
            printf("YES\n");
        else
            printf("NO\n");
    }
}