#include <bits/stdc++.h>
using namespace std;
#define REPP(i,a,b,d) for(int i=(a);i<=(int)(b);i+=(d))
#define REP(i,a,b) REPP(i,a,b,1)
#define REVV(i,a,b,d) for(int i=(a);i>=(int)(b);i-=(d))
#define REV(i,a,b) REVV(i,a,b,1)
#define FOR(i,a) for(int i=0; i<(int)(a); i++)
#define FORD(i,a) for(int i=(int)(a)-1; i>=0; i--)
#define pb push_back
typedef long long ll;

void solve() {
	int n; cin >> n;
	bool ok = 0;
	FOR(i, n) {
		int x; cin >> x;
		int sqr = sqrt(x);
		if(sqr * sqr != x) ok = 1;
	}
	cout << (ok?"YES":"NO") << '\n';
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0);
	int t; cin >> t;
	while(t--) solve();
	return 0;
}