#include <bits/stdc++.h>
#pragma GCC optimize(3)
void readint() {}
template <class T1, class... T2>
void readint(T1 &i, T2 &...rest) {
  i = 0;
  char c;
  bool f = false;
  while (!isdigit(c = getchar())) f = c == '-';
  do i = (i << 3) + (i << 1) + c - '0';
  while (isdigit(c = getchar()));
  if (f) i = -i;
  readint(rest...);
}
using namespace std;
int q;
int a[505];
int main() {
  ios::sync_with_stdio(false);
  cin >> q;
  while (q--) {
    int n;
    cin >> n;
    for (int i = 1; i <= n * 4; ++i) cin >> a[i];
    sort(a + 1, a + n * 4 + 1);
    int l = 1, r = n * 4;
    if (a[l] != a[l + 1] || a[r] != a[r - 1]) {
      cout << "NO" << endl;
      continue;
    }
    int std = a[l] * a[r];
    l += 2, r -= 2;
    while (l < r) {
      if (a[l] != a[l + 1] || a[r] != a[r - 1]) {
        cout << "NO" << endl;
        goto BREAK;
      }
      if (a[l] * a[r] != std) {
        cout << "NO" << endl;
        goto BREAK;
      }
      l += 2, r -= 2;
    }
    cout << "YES" << endl;
  BREAK:;
  }
  return 0;
}
