#include <bits/stdc++.h>
using namespace std;
int main() {
  int q, n, i, count, k;
  cin >> q;
  while (q--) {
    cin >> n;
    int a[4 * n];
    count = 0;
    for (i = 0; i < 4 * n; i++) cin >> a[i];
    sort(a, a + 4 * n);
    k = a[4 * n - 1] * a[0];
    for (i = 0; i < n; i++) {
      if (a[2 * i] * a[4 * n - 1 - 2 * i] != k || a[2 * i] != a[2 * i + 1] ||
          a[4 * n - 1 - 2 * i] != a[4 * n - 2 - 2 * i])
        count = 1;
    }
    if (count == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
