#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
int read()
{
	int res = 0, f = 0; char c = getchar();
	while(!isdigit(c) && c != '-') c = getchar();
	if(c == '-') f++, c = getchar();
	while(isdigit(c)) res = (res<<3)+(res<<1)+(c^48), c = getchar();
	return f ? -res : res;
} 

const int maxn = 1e2+10;

int check(int x)
{
	int y = sqrt(x);
	return y*y != x;
}
int n, a[maxn];
int main()
{
	int T = read(); while(T--)
	{
		n = read();
		int ans = 0;
		for(int i = 1; i <= n; i++) 
		{
			a[i] = read();
			ans |= check(a[i]);
		}
		for(int i = 1; i <= n && !ans; i++)
		for(int j = i+1; j <= n && !ans; j++)
		{
			ans |= check(a[i]*a[j]);
		}
		printf("%s\n", ans ? "YES":"NO");
	}
	return 0;
}
