#include <bits/stdc++.h>
#pragma warning(disable : 4996 6031)
using namespace std;
long long q, n, a[404];
int main() {
  scanf("%lli", &q);
  for (long long i = 1; i <= q; i++) {
    scanf("%lli", &n);
    for (long long i = 1; i <= 4 * n; i++) {
      scanf("%lli", &a[i]);
    }
    sort(a + 1, a + 1 + n * 4);
    bool jie = 0;
    for (long long i = 1; i <= 2 * n; i++) {
      if (a[i * 2] == a[i * 2 - 1]) {
        a[i] = a[i * 2];
      } else {
        jie = 1;
        break;
      }
    }
    if (jie) {
      printf("NO\n");
      continue;
    }
    long long sx = a[1] * a[2 * n];
    for (long long i = 1; i <= n; i++) {
      if (a[i] * a[n * 2 - i + 1] != sx) {
        jie = 1;
        break;
      }
    }
    if (jie) {
      printf("NO\n");
      continue;
    }
    printf("YES\n");
  }
  return 0;
}
