#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y, long long p);
int Bit(long long x);
void Fast() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
inline int D() {
  int t;
  scanf("%d", &t);
  return t;
}
inline long long llD() {
  long long t;
  scanf("%lld", &t);
  return t;
}
const int N = 1e4 + 5;
int arr[N];
int fr[N];
int n, m, k, a, b, c, len;
int l, r, mid;
long long MN, MX;
bool valid() {
  bool flage = true;
  if (len & 1) {
    MX = arr[len / 2] * arr[len / 2];
    flage &= (fr[arr[len / 2]] % 4 == 0);
  } else
    MX = 1ll * arr[0] * arr[len - 1];
  for (int i = 0; i < len / 2; ++i)
    flage &= (1ll * arr[i] * arr[len - i - 1] == MX &&
              fr[arr[i]] == fr[arr[len - i - 1]] && !(fr[arr[i]] & 1));
  return flage;
}
int main() {
  int T = D();
  while (T--) {
    len = 0;
    memset(fr, 0, sizeof(fr));
    scanf("%d", &n);
    for (int i = 0; i < 4 * n; ++i) {
      scanf("%d", &a);
      if (!fr[a]) arr[len++] = a;
      ++fr[a];
    }
    sort(arr, arr + len);
    puts(valid() ? "YES" : "NO");
  }
}
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
int Bit(long long x) {
  if (!x) return 0;
  return 1 + Bit(x >> 1);
}
