#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<=b;++i)
#define rpe(i,a,b) for(int i=a;i>=b;--i)
#define pts putchar('\n')
#define ptc putchar(' ')
#define pb push_back
typedef long long ll;
typedef unsigned long long ull;
const int inf=0x7f7f7f7f;
const int maxn=1e4+9;
const int maxm=2e2+9;
const double PI=3.1415926;
const double eps=1e-7;
const int mod=1e9+7;
const int base=131;
const int N=1e6;
namespace IO{
    ll read(){    
        ll a=1,b=0;char c=getchar();
        while(c>'9'||c<'0'){if(c=='-')a=-1;c=getchar();} 
        while(c>='0'&&c<='9'){b=(b<<3)+(b<<1)+c-'0';c=getchar();}
        return a*b ;
    }
    void print (ll x){
        if(x<0) putchar('-'),x=-x;
        if(x>9) print(x/10);
        putchar(x%10+'0');
    } 
}
using namespace IO;

int T;
int n;
int a[maxn];
bool check(){
    rep(i,1,n){
        int m=sqrt(a[i]);
        if(m*m!=a[i]) return 1;
    }
    return 0;
}
int main(){
#ifndef ONLINE_JUDGE
    freopen("in1.txt","r",stdin);
#endif
    T=read();
    while(T--){
        n=read();
        rep(i,1,n) a[i]=read();
        if(check()) puts("YES");
        else puts("NO");
    }
    return 0;
}