#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int a[maxn];
map<int, int> num;
int ans[maxn];
int main() {
  int q;
  while (~scanf("%d", &q)) {
    while (q--) {
      int n;
      num.clear();
      scanf("%d", &n);
      for (int i = 1; i <= 4 * n; ++i) {
        scanf("%d", &a[i]);
        num[a[i]]++;
      }
      bool ok = true;
      int cnt = 0;
      for (auto it = num.begin(); it != num.end(); it++) {
        if (it->second & 1) {
          ok = false;
          break;
        } else {
          for (int i = 1; i <= it->second / 2; ++i) ans[++cnt] = it->first;
        }
      }
      if (!ok) {
        printf("NO\n");
        continue;
      } else {
        bool ok = true;
        int s = -1;
        for (int i = 1, j = cnt; i < j; i++, j--) {
          if (s == -1) {
            s = ans[i] * ans[j];
            continue;
          }
          if (s != ans[i] * ans[j]) {
            ok = false;
            break;
          }
        }
        if (ok)
          printf("YES\n");
        else
          printf("NO\n");
      }
    }
  }
  return 0;
}
