#include<bits/stdc++.h>
#define ri register int
using namespace std;
int t, n, tmp;
int main(){
	cin >> t;
	start:while(t--){
		cin >> n;
		for(ri i = 0; i < n; i++){
			cin >> tmp;
			if(sqrt(tmp) - (int)sqrt(tmp) != 0){
				puts("YES");
				for(ri j = i + 1; j < n; j++) cin >> tmp;
				goto start;
			}
		}
		puts("NO");
	}
	return 0;
}