#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    ll t;
    cin>>t;
    while(t--)
    {
       ll n;
    cin>>n;
    ll a[n];
    int flag =0;
    for(ll i =0;i<n;i++)
    {
        cin>>a[i];
    }
    for(ll i =0;i<n;i++)
    {
        int x = sqrt(a[i]);
        if(x*x!=a[i])
            flag=1;
    }
    if(flag==1)
        cout<<"YES"<<endl;
        else
        cout<<"NO"<<endl; 
    }
    
}