#include <bits/stdc++.h>
    #define LL long long
    #define F first
    #define S second
    using namespace std;
    int n,t;
    int main()
    {
        
        ios_base::sync_with_stdio(0);
        cin.tie(0);cout.tie(0);
        cin>>t;
        while (t--)
        {
            int kt=0;
            cin>>n;
            for (int i=1;i<=n;i++)
            {
                int a;
                cin>>a;
                int b=sqrt(a);
                if (b*b!=a) kt=1;
            }
            if (kt==1) cout<<"YES\n";
            else cout<<"NO\n";
        }
        return 0;
    }
