#include <iostream>
#include <cmath>
using namespace std;
int main() {
	unsigned long long i, temp, islo, t;
	bool flag = false, * result;
	double second;
	cin >> t;
	result = new bool[t];
	for (int tt = 0; tt < t; tt++)
	{
		cin >> islo;
		for (i = 1; i < pow(islo, 1.0 / 3.0); i++)
		{
			temp = islo - pow(i, 3);
			second = pow(temp, 1.0 / 3);
			if (fabs(second - round(second)) < 1e-10)
			{
				flag = true;
				break;
			}
		}
		if (flag) {
			result[tt] = true;
			flag = false;
		}
		else {
			result[tt] = false;
		}
	}
	for (int tt = 0; tt < t; tt++) {
		if (result[tt])
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
}