#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int n, a;
cin >> n;
while (n--)
{
cin >> a;
bool f = false;
for (int x = 1; x * x < a; x++)
{
int y = sqrt(a - x * x);
if (y == 0)
continue;
if (y * y + x * x == a)
{
f = true;
break;
}
}
if (f)
cout << "Yes\n";
else
cout << "No\n";
}
return 0;
}