#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, i, r = 0;
    cin >> n;
    n = n * 4;
    vector<int> arr(n);
    vector<int> brr(10001, 0);
    for (i = 0; i < n; i++) {
      cin >> arr[i];
      brr[arr[i]]++;
    }
    sort(arr.begin(), arr.end());
    i = 0;
    int j = n - 1, k = arr[0] * arr[n - 1];
    while (i < j) {
      if (arr[i] != arr[i + 1] || arr[j] != arr[j - 1]) {
        r = 1;
        cout << "NO" << endl;
        break;
      }
      if (k != arr[i] * arr[j]) {
        cout << "NO" << endl;
        r = 1;
        break;
      }
      i = i + 2;
      j = j - 2;
    }
    if (r == 0) cout << "YES" << endl;
  }
}
