#include <bits/stdc++.h>
using namespace std;
const int MAXBUF = 1 << 20;
char buf[1 << 20], *fh = NULL, *ft = NULL;
inline char gc() {
  if (fh == ft) {
    int l = fread(buf, 1, MAXBUF, stdin);
    ft = (fh = buf) + l;
  }
  return *fh++;
}
inline int read() {
  int x = 0;
  char c = gc();
  for (; c < '0' || c > '9'; c = gc())
    ;
  for (; c >= '0' && c <= '9'; c = gc()) x = (x << 3) + (x << 1) + c - '0';
  return x;
}
inline void _write(long long x) {
  if (x > 9) _write(x / 10);
  putchar(x % 10 + '0');
}
inline void write(long long x) {
  _write(x);
  putchar('\n');
}
int n;
int maxn, minn;
int a[10005];
int cnt[10005];
int main() {
  int q;
  cin >> q;
  while (q--) {
    cin >> n;
    memset(cnt, 0, sizeof(cnt));
    maxn = 0, minn = 0x3f3f3f3f;
    for (int i = 0; i < n * 4; ++i) {
      cin >> a[i];
      cnt[a[i]]++;
      maxn = max(a[i], maxn);
      minn = min(a[i], minn);
    }
    bool f = 0;
    int S = maxn * minn;
    for (int i = minn; i <= maxn; ++i) {
      if (cnt[i] % 2) {
        cout << "NO" << endl;
        f = 1;
        break;
      } else if (cnt[i]) {
        if (S % i) {
          cout << "NO" << endl;
          f = 1;
          break;
        } else if (i * i == S) {
          if (cnt[i] % 4) {
            cout << "NO" << endl;
            f = 1;
            break;
          }
        } else if (cnt[S / i] != cnt[i]) {
          cout << "NO" << endl;
          f = 1;
          break;
        }
      }
    }
    if (!f) cout << "YES" << endl;
  }
  return 0;
}
