#include <bits/stdc++.h>
using namespace std;
int n, a[505], cnt[50005];
void solve() {
  scanf("%d", &n);
  n *= 4;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    cnt[a[i]]++;
  }
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    if (cnt[a[i]] & 1) {
      puts("NO");
      return;
    }
  }
  int s = -1;
  for (int i = 1; i + i <= n; i++) {
    int j = n - i + 1;
    if (cnt[a[i]] != cnt[a[j]]) {
      puts("NO");
      return;
    }
    if (s == -1) {
      s = a[i] * a[j];
      continue;
    }
    if (a[i] * a[j] != s) {
      puts("NO");
      return;
    }
  }
  puts("YES");
}
int main() {
  int T;
  cin >> T;
  while (T--) {
    memset(cnt, 0, sizeof(cnt));
    solve();
  }
  return 0;
}
