#include <bits/stdc++.h>

using namespace std;

const int N = 110;

int a[N];

bool check(int x)
{
    int y = sqrt(x);
    if(y * y == x) return false;
    return true;
}

int main()
{
    int T;
    scanf("%d", &T);
    while(T --)
    {
        int n, flag = 0;
        scanf("%d", &n);
        for (int i = 0; i < n; i ++ )
        {
            scanf("%d", &a[i]);
            if(check(a[i])) flag = 1;
        }
        if(flag) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}
