#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  scanf("%d", &q);
  while (q--) {
    int n, t = 0, i;
    scanf("%d", &n);
    n = 4 * n;
    int ara[n + 1];
    for (i = 1; i <= n; i++) {
      scanf("%d", &ara[i]);
    }
    sort(ara + 1, ara + n + 1);
    int area = ara[1] * ara[n];
    for (i = 1; i <= n / 2; i++) {
      if (ara[i] * ara[n - i + 1] != area) {
        printf("NO\n");
        t = 1;
        break;
      }
    }
    if (t == 0) {
      for (i = 1; i <= n; i += 2) {
        if (ara[i] != ara[i + 1]) {
          printf("NO\n");
          t = 1;
          break;
        }
      }
    }
    if (t == 0) {
      printf("YES\n");
    }
  }
}
