#include <bits/stdc++.h>
#include <iostream>

using namespace std;
using ll = long long;

const int MAXN = 1e4 + 2;
int sq[MAXN];

void precompute()
{
	for (int i = 1; i <= 100; ++i)
	{
		sq[i * i] = 1;
	}
}

void solve()
{
	int n;
	cin >> n;

	int ok = 0;

	for (int i = 0; i < n; ++i)
	{
		int x;
		cin >> x;
		ok |= !(sq[x]);
        // cout << "Ok is " << ok << endl;
	}

	if (ok)
		cout << "YES\n";
	else cout << "NO\n";
}

int main()
{
	int t;
	cin >> t;

    precompute();

	while (t--)
	{
		solve();
	}

	return 0;
}