#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<int> vll;
typedef pair<int, int> pii;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define ALL(v) v.begin(), v.end()
#define rALL(v) v.rbegin(), v.rend()
#define INF 1000000007LL
#define MOD 998244353LL

const int LIM = 2e5 + 5;

void solve()
{
    int n, x, f, res = 0;
    cin >> n;
    for(int i = 0; i < n; i++)
    {
        cin >> x;
        f = 0;
        for(int j = 1; j * j <= x; j++)
            if(j * j == x)
            {
                f = 1;
                break;
            }
        if(f == 0)
            res = 1;
    }

    if(res)
        cout << "YES\n";
    else
        cout << "NO\n";
    
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int t = 1;
    cin >> t;
    while (t--)
    {
        solve();
    }

    return 0;
}
