#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long int j, i, n, t, l, c, h, k, da, m, maxi, d, s, x, area;
  cin >> t;
  for (i = 0; i < t; i++) {
    cin >> n;
    n = 4 * n;
    k = 0;
    long long int a[n];
    long long int f[10002] = {0};
    for (j = 0; j < n; j++) {
      cin >> a[j];
      f[a[j]]++;
    }
    for (j = 0; j < 10002; j++) {
      if (f[j] % 2 != 0) {
        k = 1;
        break;
      }
    }
    if (k == 1) {
      cout << "NO" << endl;
      continue;
    }
    sort(a, a + n);
    k = 0;
    area = a[0] * a[n - 1];
    for (j = 0; j < n / 2; j++) {
      if (j % 2 == 0) {
        c = a[j] * a[n - 1 - j];
      }
      if (c != area) k = 1;
    }
    if (k == 1) {
      cout << "NO" << endl;
      continue;
    }
    cout << "YES" << endl;
  }
}
