#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;

void process(){
	int n;
	cin >> n;
	//cout << "n: " << n << endl;
	int a[n];
	for(int i=0; i<n; i++){
		cin >> a[i];
	}
	int x, sq;
	bool yes = false;
	for(int i=0; i<n; i++){
		x = sqrt(a[i]);
		sq = (x * x);
		if(sq != a[i]){
			yes = true;
			break;
		}
	}
	cout << (yes ? "YES" : "NO") << endl;
}

int main(){
	int T;
	cin >> T;
	for(int i=0; i<T; i++){
		//cout << "i: " << i << endl; 
		process();
	}
	return 0;
}