#define ll long long 
#include <bits/stdc++.h>
using namespace std;

int sqrRoot(int n){
    int  ans=0;
    while(ans*ans<=n){
       ans+=1;
    }
    ans-=1;
    return ans;
}

void solve(){
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    for(int i=0;i<n;i++){
        int temp=sqrRoot(a[i]);
        if(temp*temp!=a[i]){
            cout<<"YES"<<endl;
            return;
        }
    }
    cout<<"NO"<<endl;
    return;
    
}


int main() {
    int t;
    cin>>t;
    while(t--){
        solve();
    }
    return 0;
}
