#include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
#include <vector>
using namespace std;
typedef long long ll;
const int inf=0x3f3f3f3f;
const int N = 3e4+10;

int a[N];
void solve(){
    int n;
    cin >> n;
    for(int i = 1; i <= n; i ++){
        cin >> a[i];
    }
    for(int i = 1; i <= n; i ++){
        if((int)sqrt(a[i])*(int)sqrt(a[i])!=a[i]){
            puts("YES");
            return;
        }
    }
    puts("NO");
}
int main(){
    int T;
    cin >> T;
    
    while(T--){
        solve();
    }
    return 0; 
}