#include <bits/stdc++.h>
using namespace std;
const int S = 500005;
int a[S];
int main() {
  int q, n;
  cin >> q;
  for (int qq = 0; qq < q; qq++) {
    cin >> n;
    n *= 4;
    for (int i = 1; i <= 10000; i++) a[i] = 0;
    for (int i = 0; i < n; i++) {
      int x;
      cin >> x;
      a[x]++;
    }
    int lw = 1, hg = 10000;
    int ar = -1;
    bool ans = 1;
    while (lw <= hg) {
      if (a[lw] < 1) {
        lw++;
        continue;
      }
      if (a[hg] < 1) {
        hg--;
        continue;
      }
      if (a[lw] % 2 || a[hg] % 2) {
        ans = 0;
        break;
      }
      if (lw == hg && a[lw] < 4) {
        ans = 0;
        break;
      }
      if (ar != -1 && lw * hg != ar) {
        ans = 0;
        break;
      }
      ar = lw * hg;
      a[lw] -= 2;
      a[hg] -= 2;
    }
    if (ans)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
