#include <bits/stdc++.h>
#include <iostream>
using namespace std;

#define db cout << "debugging...\n";
#define db1(x) cout << #x << " = " << x << '\n'
#define db2(x, y) cout << #x << " = " << x << ", " << #y << " = " <<y << '\n'
#define db3(x, y, z) cout << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << '\n'
#define dbvec(a) cout << #a << ": "; for (auto x: a) cout << x << " "; cout << "\n"

#define int long long
#define pb push_back
#define all(x) x.begin(), x.end()
#define endl '\n'
#define fileio freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout)
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
const int MOD = 1000000007;

int32_t main() {
    fastio;
    // fileio;

    int t;
    cin >> t;

    while (t--) {

        int n;
        cin >> n;

        bool b = true;

        for (int i = 0; i < n; ++i) {
            int x;
            cin >> x;

            // db3(t, n, x);

            int sqrtt = sqrt(x);
            sqrtt *= sqrtt;

            if (sqrtt != x) {
                b = false;
            }
        }

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

    }

    return 0;
}