#include <bits/stdc++.h>
using namespace std;
using LL = long long;
namespace _buff {
const size_t BUFF = 1 << 19;
char ibuf[BUFF], *ib = ibuf, *ie = ibuf;
char getc() {
  if (ib == ie) {
    ib = ibuf;
    ie = ibuf + fread(ibuf, 1, BUFF, stdin);
  }
  return ib == ie ? -1 : *ib++;
}
}  // namespace _buff
LL read() {
  using namespace _buff;
  LL ret = 0;
  bool pos = true;
  char c = getc();
  for (; (c < '0' || c > '9') && c != '-'; c = getc()) {
    assert(~c);
  }
  if (c == '-') {
    pos = false;
    c = getc();
  }
  for (; c >= '0' && c <= '9'; c = getc()) {
    ret = (ret << 3) + (ret << 1) + (c ^ 48);
  }
  return pos ? ret : -ret;
}
bool solve() {
  int n = read() << 2;
  map<int, int> mp;
  vector<vector<int> > vc(n + 1);
  for (int i = 0; i < n; ++i) {
    ++mp[read()];
  }
  for (auto [x, c] : mp) {
    if (c & 1) {
      return false;
    }
    vc[c >> 1].emplace_back(x);
  }
  int area = 0;
  for (int i = 1; i <= n; ++i) {
    if (vc[i].empty()) continue;
    sort(vc[i].begin(), vc[i].end());
    int sz = vc[i].size() - 1, p = 0;
    for (; sz - p >= p; ++p) {
      int cur = vc[i][p] * vc[i][sz - p];
      if (area && cur != area) {
        return false;
      }
      area = cur;
      if (p == sz - p && (i & 1)) {
        return false;
      }
    }
  }
  return true;
}
int main() {
  int q = read();
  while (q--) {
    puts(solve() ? "yes" : "no");
  }
  return 0;
}
