#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
void solve() {
int n;
cin >> n;
long long total = 0;
for (int i = 0; i < n; ++i) {
int a;
cin >> a;
total += a;
}
long long root = sqrt(total);
if (root * root == total) {
cout << "YES\n";
} else {
cout << "NO\n";
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t;
cin >> t;
while (t--) {
solve();
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8Y21hdGg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgp2b2lkIHNvbHZlKCkgewogICAgaW50IG47CiAgICBjaW4gPj4gbjsKICAgIAogICAgbG9uZyBsb25nIHRvdGFsID0gMDsKICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbjsgKytpKSB7CiAgICAgICAgaW50IGE7CiAgICAgICAgY2luID4+IGE7CiAgICAgICAgdG90YWwgKz0gYTsKICAgIH0KICAgIAogICAgbG9uZyBsb25nIHJvb3QgPSBzcXJ0KHRvdGFsKTsKICAgIGlmIChyb290ICogcm9vdCA9PSB0b3RhbCkgewogICAgICAgIGNvdXQgPDwgIllFU1xuIjsKICAgIH0gZWxzZSB7CiAgICAgICAgY291dCA8PCAiTk9cbiI7CiAgICB9Cn0KCmludCBtYWluKCkgewogICAgaW9zOjpzeW5jX3dpdGhfc3RkaW8oZmFsc2UpOwogICAgY2luLnRpZShudWxscHRyKTsKICAgIAogICAgaW50IHQ7CiAgICBjaW4gPj4gdDsKICAgIHdoaWxlICh0LS0pIHsKICAgICAgICBzb2x2ZSgpOwogICAgfQogICAgcmV0dXJuIDA7Cn0=