#include <bits/stdc++.h>
using namespace std;
int n, l[405];
map<int, int> m;
bool check() {
  for (auto x : m) {
    if (x.second % 2) return false;
  }
  bool ok;
  map<int, int> tmp, used;
  for (int i = 2; i <= 4 * n; i++) {
    int s = l[1] * l[i];
    if (used[s]) continue;
    used[s] = 1;
    tmp = m;
    ok = true;
    for (auto x : tmp) {
      if (x.second) {
        int v = s / x.first;
        if (tmp[v] != x.second || v * x.first != s) {
          ok = false;
          break;
        }
        tmp[v] = 0;
      }
    }
    if (ok) return true;
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    cin >> n;
    m.clear();
    for (int i = 1; i <= 4 * n; i++) {
      cin >> l[i];
      m[l[i]]++;
    }
    if (check())
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
