#include <bits/stdc++.h>
#define nl "\n"
# define io ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ll long long int
const ll MAX = 1e12;
using namespace std;
const int alpha = 26;

set<ll>s;

void solve(){
   int n;cin>>n;
    vector<int>arr(n);
    bool ok = false;
    for(int i=0;i<n;i++) {
        cin >> arr[i];
        if(!s.count(arr[i])){
            ok= true;
        }
    }
    if(ok)
        cout <<"YES" <<nl;
    else
        cout <<"NO" <<nl;
}


int main()
{
    for(int i=1;i<=200;i++)
        s.insert(i*i);
    int t;cin>>t;
    while (t--)
        solve();
    return 0;
}