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

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


int32_t main(){
    int t;
    cin >> t;
    while(t--){
        int n;
        cin >> n;
        solve(n);
    }
}

