#include <bits/stdc++.h>
using namespace std;
const int maxn = 10005;
map<int, int> qq;
int a[maxn];
int b[maxn];
int main() {
  int q;
  scanf("%d", &q);
  while (q--) {
    int n;
    scanf("%d", &n);
    qq.clear();
    for (int i = 1; i <= n * 4; i++) {
      scanf("%d", &a[i]);
      qq[a[i]]++;
    }
    int fi = 0;
    int temp = 0;
    for (int i = 1; i <= n * 4; i++) {
      if (qq[a[i]] & 1) {
        fi = 1;
        break;
      } else if (qq[a[i]] != 0) {
        int jishu = qq[a[i]] / 2;
        while (jishu) {
          b[temp++] = a[i];
          jishu--;
        }
        qq[a[i]] = 0;
      }
    }
    if (fi == 1) {
      printf("NO\n");
    } else {
      sort(b, b + temp);
      if (temp & 1) {
        printf("NO\n");
      } else {
        int i = temp - 1;
        int j = 0;
        long long int area = 1ll * b[j] * b[i];
        int fi = 0;
        while (j < i) {
          if (area != 1ll * b[j] * b[i]) {
            fi = 1;
          }
          j++;
          i--;
        }
        if (fi) {
          printf("NO\n");
        } else {
          printf("YES\n");
        }
      }
    }
  }
}
