#include <bits/stdc++.h>

int main() {
    int t;
    std::cin >> t;
    while (t-->0) {
        int n;
        std::cin >> n;
        bool ans = false;
        while (n-->0) {
            double temp;
            std::cin >> temp;
            if (sqrt(temp) != int(sqrt(temp))) {
                ans = true;
            }
        }
        std::cout << (ans ? "YES\n" : "NO\n");
    }
}
