#include <bits/stdc++.h>
using namespace std;
int X, W;
char ch;
inline int read() {
  X = 0, W = 1;
  ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') W = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    X = (X << 1) + (X << 3) + ch - 48;
    ch = getchar();
  }
  return X * W;
}
int ex[100001], flag, num, need;
bool cnt[10001];
bool work() {
  flag = 0, num = 0;
  memset(cnt, false, sizeof(cnt));
  int n = read();
  n <<= 2;
  for (int i = 1, _; i <= n; i++) {
    _ = read();
    if (cnt[_])
      ex[++num] = _, cnt[_] = false, flag--;
    else
      cnt[_] = true, flag++;
  }
  if (flag) return false;
  sort(ex + 1, ex + num + 1);
  need = ex[1] * ex[num];
  for (int i = 2; i <= num / 2; i++)
    if (ex[i] * ex[num - i + 1] != need) return false;
  return true;
}
int main() {
  int T = read();
  while (T--) {
    if (work())
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
