#include <bits/stdc++.h>
using namespace std;
int q;
int n;
int a[401];
inline int read() {
  int res = 0, sign = 1;
  char c;
  while ((c = getchar()) < '0' || c > '9')
    if (c == '-') sign = -1;
  res = c - '0';
  while ((c = getchar()) >= '0' && c <= '9') res = res * 10 + c - '0';
  return res * sign;
}
int main() {
  q = read();
  int i, ok, s;
  while (q--) {
    n = read();
    for (i = 1; i <= 4 * n; i++) {
      a[i] = read();
    }
    sort(a + 1, a + 4 * n + 1);
    ok = 1, s = 0;
    for (i = 1; i <= n; i++) {
      if (a[2 * i - 1] != a[2 * i] ||
          a[4 * n - 2 * i + 2] != a[4 * n - 2 * i + 1]) {
        ok = 0;
        break;
      }
      if (!s)
        s = a[2 * i] * a[4 * n - 2 * i + 1];
      else {
        if (a[2 * i] * a[4 * n - 2 * i + 1] != s) {
          ok = 0;
          break;
        }
      }
    }
    if (ok)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
