#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
int main()
{
	int t; cin >> t;
	vector<string>result(t,"NO");
	for (int i = 0; i < t; ++i) {
		int n; cin >> n;
		vector<int>a(n);
		for (int j = 0; j < n; ++j)  cin >> a[j]; 
		for (int j = 0; j < n; ++j) {
			bool flag = false;
			for (int jj = 1; jj <= a[j]; ++jj) {
				if (jj * jj > a[j]) break;
				if (jj * jj == a[j]) flag = true;
			}
			if (!flag) {
				result[i] = "YES";
				break;
	 }
		}
		}
	for (int i = 0; i < result.size(); ++i) {
		cout << result[i] << endl;
	}
}
