#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
#define all(x) x.begin() , x.end()
#define ld long double
const long long inf = 1e18 + 5LL;
const int mod = 998244353 ; //1e9 + 7LL;
const int N = (2e5 + 10);
void solve(int t);
void ITO();
int32_t main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	ITO();
	int t = 1;
	cin >> t;
	for (int i = 0; i < t; i++) solve(i + 1);
	return 0;
}
void solve(int TcNumber)
{
	int n ; cin >> n;
	int arr[n]; for (auto &x : arr) cin >> x;
	bool ok = 0;
	for (auto x : arr) {
		int y = sqrt(x);
		if (y * y != x) ok = 1;
	}
	cout << (ok ? "YES" : "NO");
	cout << "\n";
	return ;
}
void ITO()
{
#ifndef ONLINE_JUDGE
	freopen("inputf.in", "r", stdin);
	freopen("outputf1.in", "w", stdout);
#endif
}
