#include <bits/stdc++.h>
using namespace std;
int main() {
  int q, i, n, nn, x, l, a;
  vector<int> v;
  cin >> q;
  while (q--) {
    l = 0;
    v.clear();
    cin >> nn;
    n = 4 * nn;
    for (i = 0; i < n; i++) {
      cin >> x;
      v.push_back(x);
    }
    sort(v.begin(), v.end());
    for (i = 0; i < n; i = i + 2) {
      if (v[i] != v[i + 1]) l++;
    }
    a = v[n - 1] * v[0];
    for (i = 1; i < n / 2; i = i + 2) {
      if (a != (v[n - i] * v[i])) l++;
    }
    if (l == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
