#include <bits/stdc++.h>
int main() {
  int q, n, i, j;
  scanf("%d", &q);
  while (q--) {
    scanf("%d", &n);
    int a[n * 4], k = 1, b[10001] = {0}, max = 0, min = 10005;
    for (i = 0; i < n * 4; ++i) {
      scanf("%d", &a[i]);
      b[a[i]]++;
      if (a[i] > max) max = a[i];
      if (a[i] < min) min = a[i];
    }
    for (i = min; i <= max; i++) {
      if (b[i] % 2 != 0) {
        k = 0;
        break;
      }
      if (b[i] != 0) {
        if ((max * min) % i != 0) {
          k = 0;
          break;
        } else {
          if (b[i] != b[(max * min) / i]) k = 0;
        }
      }
    }
    printf("%s\n", k ? "YES" : "NO");
  }
}
