// Bài 2: Phân tích thừa số nguyên tố (chưa đếm YES)
#include<bits/stdc++.h>
#define f1(i, n) for(int i=1;i<=n;++i)
#define f0(i, n) for(int i=0;i<n;++i)
#define ull unsigned long long
#define ll long long
#define rev(a) reverse(a.begin(),a.end())
#define all(x) x.begin(),x.end()
#define so(A, n) sort(A+1, A+n+1)
using namespace std;
const int maxn = 1e6 + 1;
using namespace std;
map<int, int> mp;
int A[maxn];
int main() {
int n;
cin >> n;
f1(i, n) {
bool check = true;
cin >> A[i];
int a = A[i];
for (int j = 2; j <= sqrt(a); ++j) {
while (a % j == 0) {
a /= j;
mp[j]++;
}
}
if (a > 1) {
mp[a]++;
}
for(auto x:mp){
if(x.second % 2 != 0){
cout<<"NO ";
check = false;
break;
}
}
if(check){
cout<<"YES ";
}
}
}
Ly8gQsOgaSAyOiBQaMOibiB0w61jaCB0aOG7q2Egc+G7kSBuZ3V5w6puIHThu5EgKGNoxrBhIMSR4bq/bSBZRVMpCiNpbmNsdWRlPGJpdHMvc3RkYysrLmg+CiNkZWZpbmUgZjEoaSwgbikgZm9yKGludCBpPTE7aTw9bjsrK2kpCiNkZWZpbmUgZjAoaSwgbikgZm9yKGludCBpPTA7aTxuOysraSkKI2RlZmluZSB1bGwgdW5zaWduZWQgbG9uZyBsb25nCiNkZWZpbmUgbGwgbG9uZyBsb25nCiNkZWZpbmUgcmV2KGEpIHJldmVyc2UoYS5iZWdpbigpLGEuZW5kKCkpCiNkZWZpbmUgYWxsKHgpIHguYmVnaW4oKSx4LmVuZCgpCiNkZWZpbmUgc28oQSwgbikgc29ydChBKzEsIEErbisxKQp1c2luZyBuYW1lc3BhY2Ugc3RkOwpjb25zdCBpbnQgbWF4biA9IDFlNiArIDE7CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cm1hcDxpbnQsIGludD4gbXA7CmludCBBW21heG5dOwppbnQgbWFpbigpIHsKCWludCBuOwoJY2luID4+IG47CglmMShpLCBuKSB7CgkJYm9vbCBjaGVjayA9IHRydWU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