#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  int n;
  int i, j;
  int a[10100];
  int b[300];
  int t1;
  int num;
  int sum;
  int fla;
  scanf("%d", &T);
  while (T--) {
    num = 0;
    fla = 0;
    scanf("%d", &n);
    for (i = 0; i < 10100; i++) a[i] = 0;
    for (i = 0; i < n * 4; i++) {
      scanf("%d", &t1);
      a[t1]++;
      if (a[t1] == 2) {
        b[num] = t1;
        a[t1] = 0;
        num++;
      }
    }
    if (num != n * 2) {
      printf("NO\n");
      continue;
    }
    sort(b, b + num);
    sum = b[0] * b[num - 1];
    for (i = 1; i < num / 2; i++) {
      if (b[i] * b[num - i - 1] != sum) {
        fla = 1;
        break;
      }
    }
    if (fla == 0)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
