// Problem: A. Perfectly Imperfect Array
// Contest: Codeforces - Codeforces Round #716 (Div. 2)
// URL: https://codeforces.com/contest/1514/problem/0
// Memory Limit: 256 MB
// Time Limit: 1000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <map>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <sstream>
#define ll long long
#define re return

using namespace std;

typedef pair<int, int> PII;

int dx[4] = {-1,0,1,0};
int dy[4] = {0,1,0,-1};

int T;
int n;
int a[110];

int main(){
	cin >> T;
	while(T--){
		cin >> n;
		// ll summ = 1;
		int t = 0;
		for(int i = 1; i <= n; i++){
			scanf("%d", a + i);
			int s = sqrt(a[i]);
			if(s * s != a[i]){
				t = 1;
			}
		}
		if(!t) {
			cout << "NO" << endl;
		}
		else{
			cout << "YES" << endl;
		}
	}
	re 0;
}