#include <iostream>
#include <math.h>

using namespace std;

int main()
{
    int k, l, n, j, i, item, flag=0;
    double coun;
    int a[105];
    cin >> k;
    for (l = 0; l < k; l++) {
        cin >> n;
        for (i = 0; i < n; i++) {
            cin >> a[i];
            coun = (double)a[i];
            item = (int)sqrt(coun);
            item *= item;
            if (item != a[i]) {
                flag = 1;
            }
        }
        if (flag) {
            cout << "YES\n";
        }
        else {
            cout << "NO\n";
        }
        flag = 0;
    }
    return 0;
}
