#include <bits/stdc++.h>
#define ll long long
#define mod 100000000
#define N 2010
#define long_long_MAX 9187201950435737471
#define long_long_MIN -9187201950435737472
#define int_MAX 2139062143
#define int_MIN -2139062144
#define jh(x, y) (x ^= y ^= x ^= y)
#define loc(x, y) ((x - 1) * m + y)
#define lowbit(x) (x & -x)
using namespace std;

ll max(ll x,ll y){return x > y ? x : y;}

ll min(ll x,ll y){return x > y ? y : x;}

inline ll read()
{
    ll a=0;ll f=0;char p=getchar();
	while(!isdigit(p)){f|=p=='-';p=getchar();}
	while(isdigit(p)){a=(a<<3)+(a<<1)+(p^48);p=getchar();}
	return f?-a:a;
}

inline void print(ll x)
{
    if(!x) return;
    if(x) print(x/10);
    putchar(x%10+'0');
}

ll t,n,a[N],sum[N];

int main()
{
    t = read();
    while(t--)
    {
        n = read();
        sum[0] = 1;
        for(int i = 1;i <= n;++i) a[i] = read();
        int ok = 0;
        for(int i = 1;i <= n;++i)
        {
            ll x = a[i];
            ll y = sqrt(a[i]);
            if(x % y || x / y != y)
            {
                ok = 1;
                break;
            }
        }
        if(ok) printf("YES\n");
        else printf("NO\n");
    }
    //system("pause");
    return 0;
}
