#include<bits/stdc++.h>
    using namespace std;
    #define FIO  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    #define endl ("\n")
    #define ll long long int
    #define w(T) ll T;cin>>T;while(T--)
    #define vi vector<ll>
    #define vp vector<pair<ll,ll>>
    #define vs vector<pair<ll,char>>
    #define pb push_back
    #define mp make_pair
    #define f(i,a,b) for(i=a;i<b;++i)
    #define F(i,a,b) for(i=a;i>=b;--i)
    #define rep(i,a,b) for(i=a;i<=b;++i)
    #define sort(v) sort(v.begin(),v.end())
    #define rev(v)  reverse(v.begin(),v.end())
    #define mod 1000000007
     
    template<typename T,typename T1>T amax(T &a,T1 b){if(b>a)a=b;return a;}
    template<typename T,typename T1>T amin(T &a,T1 b){if(b<a)a=b;return a;}
    //generate testcases and check for that also
    //check for boundary conditions and corner testcases
    //read solution before submitiing
    //check constraints for every loop
    //if stuck for more than 20 min move to next question
     
    //last but not least
     
    //FUCK RATINGS , I AM IN LOVE WITH EXPERIENCE 
     
    ll cc=0;
    bool isPrime(ll n)
    {
        
        if (n <= 1)  return false;
        if (n <= 3)  return true;
       
        
        if (n%2 == 0 || n%3 == 0) return false;
       
        for (ll i=5; i*i<=n; i=i+6)
            if (n%i == 0 || n%(i+2) == 0)
               return false;
       
        return true;
    }
     
     
     
    ll pw(ll x , ll y)
    {
        ll i=0;
        ll ans=1;
        for(i=1;i<=y;++i)
        ans=(ans*x)%mod;
        return ans;
    }
     
    ll sumdig(ll n)
    {
        ll ans=0;
        while(n>0)
        {
            ans+=n%10;
            n/=10;
        }
        return ans;
    }
    ll countdig(ll x)
    {
        ll cou=0;
        while(x>0)
        {
            cou++;
            x/=10;
        }
        return cou;
    }
    ll fact(ll n)
    {
        ll ans=1;
        for(ll i=1;i<=n;++i)
        ans=(ans*i)%mod;
        
        return ans;
    }
     
     
    void solve()
    { 
    set<ll> st,st2;
     
    unordered_map<ll,ll> um,um2;
    map <ll,ll> m1,m2;
    string s,s1,s2,s3,t;
    char ch;
    ll i{}, j{},k{},x{},y{},z{},n{},u{},l{},m{},h{},w{},o{},p{},q{},r{},a{},b{},c{},d{},sum{},ans{},ans2{10000000},ans1{10000000};
     
     
     
    
    cin>>n;
    vi v1(n);
    
    
    p=0;
    
    f(i,0,n)
    cin>>v1[i];
    
    
    f(i,0,n){

     
    z=sqrt(v1[i]);
     
    if(v1[i]!=z*z)
    {
        
        
        p=1;
        break;
    }
    
    }
     
    p==1?cout<<"YES"<<endl:cout<<"NO"<<endl;
     
     
     
     
     
     
     
     
     
     
    }
     
     
     
     
    int main()
    {
        //     #ifndef ONLINE_JUDGE
        // // for getting input from input.txt
        // freopen("input.txt", "r", stdin);
        // // for writing output to output.txt
        // freopen("output.txt", "w", stdout);
        // #endif
     
        // USED WHEN PERMISSION DENIED ON OUTPUT FILE ON CMD 
    // taskkill /F/IM "executable name.exe" /T 
        
        FIO
     
       
        w(T){
     
        cc++;
        solve();
        }
        
     
       
     
        
     }