#include <bits/stdc++.h>
#pragma GCC optimize("-O3")
using namespace std;
pair<long long, long long> exgcd(const long long x, const long long y) {
  if (!y) return {1, 0};
  pair<long long, long long> c = exgcd(y, x % y);
  return {c.second, c.first - (x / y) * c.second};
}
long long fpow(long long a, long long b, long long m) {
  long long r = 1;
  for (a %= m; b; a = a * a % m, b >>= 1)
    if (b & 1) r = r * a % m;
  return r;
}
const long long __mod__ = 1e9 + 7;
long long mod(long long x, long long p = __mod__) { return ((x % p) + p) % p; }
long long mmod() { return 1; }
template <class... U>
long long mmod(const long long &hd, const U &...tl) {
  return mod((hd % __mod__) * mmod(tl...), __mod__);
}
template <class T>
ostream &operator<<(ostream &out, const vector<T> &vec) {
  const int n = vec.size();
  for (int i = 0; i < n; i++) out << vec[i] << (i == n - 1 ? "" : " ");
  return out;
}
template <class T, class U>
ostream &operator<<(ostream &out, const pair<T, U> &p) {
  out << '<' << p.first << ", " << p.second << '>';
  return out;
}
void Main();
void print() { cout << "\n"; }
template <class T, class... U>
void print(const T &hd, const U &...tl) {
  cout << hd << (sizeof...(tl) ? " " : "");
  print(tl...);
}
void scan() {}
template <class T, class... U>
void scan(T &x, U &...tl) {
  cin >> x;
  scan(tl...);
}
long long fmul(long long a, long long b, long long m) {
  long long d = (long long)floor(a * (long double)b / m + 0.5);
  long long r = (a * b - d * m) % m;
  if (r < 0) r += m;
  return r;
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  Main();
}
void Main() {
  int q;
  cin >> q;
  while (q--) {
    int n;
    cin >> n;
    map<int, int> mp;
    for (int i = 0; i < n * 4; i++) {
      int t;
      cin >> t;
      mp[t]++;
    }
    bool flag = true;
    int r = 0;
    vector<int> v;
    for (auto &x : mp) {
      if (x.second & 1) {
        flag = false;
        goto P;
      }
      for (int i = 0; i < x.second / 2; i++) {
        v.push_back(x.first);
      }
    }
    r = v[0] * v.back();
    for (int i = 0, j = (int(v.size())) - 1; i < j; i++, j--) {
      if (v[i] * v[j] != r) {
        flag = false;
        goto P;
      }
    }
  P:
    cout << (flag ? "YES\n" : "NO\n");
  }
}
