#include <iostream>
#include <cmath>
using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    int t;
    cin >> t;
    while (t--){
    	
    	long long n;
    	cin >> n;
    	long long total = 0;
    	
    	for(int i = 0; i<n; i++){
    		long long a;
    		cin >> a;
    		total += a;
    	}
    	
    	int akar = sqrt(total);
    	
    	if (akar * akar == total) {
    		cout << "YES" << endl;
    	} else { 
    		cout << "NO" << endl; 
    	}
    }
	return 0;
}