#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
#define int ll
#define sz(a) int(a.size())
#define dbg(a) cout << #a << " = " << a << endl
#define dbg1(a) cout << #a << " = [ "; for (auto& _ : a) cout << _ << ' '; cout << "]" << endl
#define dbg2(a) cout << #a << " = [ "; for (auto& _ : a) cout << '(' << _.first << ' ' << _.second << ") "; cout << "]" << endl
const int inf = int(1e9) + 7;
void solve() {
  int n;
  cin >> n;
  bool ok = false;
  for (int i = 0; i < n; ++i) {
    int q;
    cin >> q;
    ok |= q != int(sqrt(q)) * int(sqrt(q));
  }
  cout << (ok ? "YES\n" : "NO\n");
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(15);
  int tests = 1;
  cin >> tests;
  while (tests--) {
    solve();
  }
}