#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main(){
	int t;
	scanf("%d",&t);
	while(t--){
		int n;
		scanf("%d",&n);
		int val;
		bool flag=1;
		for(int i=1;i<=n;i++){
			scanf("%d",&val);
			int x=sqrt(val);
			if(x*x!=val) flag=0;
		}
		puts(flag?"NO":"YES");
	}
	return 0;
}