#include <iostream>
#include <cmath>

using namespace std;

typedef long long int ll;

int main(){
	int cases;
	ll num;
	double temp;
	cin >> cases;
	bool cube = false;
	for(int a = 0; a < cases; a++){
		cin >> num;
		cube = false;
		for(ll b = max(int(cbrt(double(num/2))), 1); b < cbrt(num) && cube == false; b++){
			temp = cbrt(num - pow(b, 3));
			if(abs(temp - int(temp)) < pow(10, -9)) cube = true;
		}
		printf(cube ? "YES\n" : "NO\n");
	}
	return 0;
}