#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")  
#pragma GCC target("avx,avx2,fma")
using namespace std;
bool perfectCube(long long int N){
    long long int cube_root;
    cube_root = round(cbrt(N));
    if (cube_root * cube_root * cube_root == N) {
        return true;
    }
    else {
        return false;
    }
}
void solve(){
    long long int n;
    cin >> n;
    if(n == 1LL){
        cout << "NO\n";
        return;
    }
    long long int i = 1LL;
    while(i*i*i < n){
        long long int tmp = n - i*i*i;
        if(perfectCube(tmp)){
            cout << "YES\n";
            return;
        }
        i++;
    }
    cout << "NO\n";
    return;
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int t = 1;
    cin >> t;
    while(t--){
        solve();
    }
}