#include<bits/stdc++.h>

using namespace std;

using ll = long long int;
typedef pair<int,int> ppi;

// cout << "Case #" << i << ": " << solve() << endl; 

bool isPS(ll x) {
  ll y = sqrt(x);
  return (y*y == x);
}
void solve() {
  ll n;
  cin >> n;
  ll a[n];
  for(int i=0;i<n;i++) {
      cin >> a[i];
  }

  for(int i=0;i<n;i++) {
      if(isPS(a[i]) == false) {
        cout << "YES" << endl;
        return;
      }
  }

  cout << "NO" << endl;
}
int main() {

#ifndef ONLINE_JUDGE
  freopen("input.txt","r",stdin);
  freopen("output.txt","w",stdout);
#endif
  
   int t;
   cin >> t;
   while(t--) {
    solve();
   }


  return 0;
}



