#include <bits/stdc++.h>
using namespace std;
long long T, s, i, a[100000], x, y, z, t, r, n, d;
bool kt;
int main() {
  cin >> T;
  while (T--) {
    cin >> n;
    s = 1;
    for (i = 1; i <= 4 * n; i++) {
      cin >> a[i];
    }
    sort(a + 1, a + 1 + 4 * n);
    r = a[1] * a[4 * n];
    kt = true;
    for (i = 1; i <= 2 * n; i += 2) {
      x = a[i];
      y = a[i + 1];
      z = a[4 * n - i + 1];
      t = a[4 * n - i];
      if ((x != y) || (z != t) || (x * z != r)) kt = false;
    }
    if (kt == false)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
  return 0;
}
