#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<set>
#include<map>

using namespace std;

#define x first
#define y second
#define NMAX 100005

long long t, n, v[NMAX];

bool binarySearch(long long value) {
    long long left = 1, right = min(n, (long long)NMAX);
    while(left <= right) {
        long long mid = (left + right) / 2;
        long long pos_val = mid * mid * mid;
        if(pos_val == value) {
            return true;
        }
        if(pos_val < value) {
            left = mid + 1;
        }
        else {
            right = mid - 1;
        }
    }
    return false;
}

int main () {
    
    scanf("%lld", &t);
    for(;t;t--) {
        scanf("%lld", &n);
        int ok = 0;
        for(long long a = 1; a * a * a < n && !ok; a++) {
            long long bcube = n - a * a * a;
            if(binarySearch(bcube)) {
                ok = 1;
            }
        }
        if(ok) {
            printf("YES\n");
        }       
        else {
            printf("NO\n");
        }
    }
    
    return 0;
}