#include <iostream>
#include <cstring>
#include <cmath>
#include <vector>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <list>
#include <iomanip>
#include <algorithm>
#include <climits>
//#define int long long
#define mp make_pair
#define fir it->first
#define sec it->second
#define fir1 it1->first
#define sec1 it1->second
#define pii pair<int,int>
#define pb push_back
using namespace std;
const int mod = 1e9 + 7;
int t,n,a[10001];
void ans(){
    for(int i = 1; i <= n; i++){
        if(sqrt(a[i])!=(int)(sqrt(a[i]))){
            cout << "YES" << endl;
            return;
        }
    }
    cout << "NO" << endl;
}
void solve(){
    cin >> t;
    while(t--){
        cin >> n;
        for(int i = 1; i <= n; i++){
            cin >> a[i];
        }
        ans();
    }
}
signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    solve();
}