#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define N 100005
#define MOD 1000000007
#define dd double
#define vi vector<int>
#define vll vector<ll>
#define forr(i, n) for(ll i = 0; i < n; i++)
#define forj(j,m)  for(ll j=0;j<m;j++)
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define rep1(i,b) for(ll i=1;i<=b;i++)
#define inp(a,n) for(ll i=0;i<n;i++)cin>>a[i]
#define outp(a,n) for(ll i=0;i<n;i++)cout<<a[i]<<" "
#define pb push_back
#define mp make_pair
#define mem(x,n) memset(x,n,sizeof(x))
#define NFS ios_base::sync_with_stdio(false); cin.tie(NULL);
#define test ll t; cin>>t; while(t--)
int main()
{
    NFS
    test
    {
        ll n;
        cin>>n;
        vector<ll>v;
        ll f=0;
        forr(i,n)
        {
            ll x;
            cin>>x;
            v.pb(x);
            ll g=x;
            ll a=sqrt(x);
            if(a*a!=g)
            f=1;
        }
        if(f==1)
        cout<<"YES\n";
        else
        {
            cout<<"NO\n";
        }
        
    }
return 0;
}
