#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int maxn = 1e4 + 10;
int tong[maxn];
int main() {
  std::ios::sync_with_stdio(false);
  int q;
  cin >> q;
  while (q--) {
    memset(tong, 0, sizeof tong);
    int n;
    cin >> n;
    int minx = INF, maxx = -INF;
    for (int i = 0; i < 4 * n; i++) {
      int a1;
      cin >> a1;
      minx = min(a1, minx);
      maxx = max(a1, maxx);
      tong[a1]++;
    }
    int area = minx * maxx;
    int res = 0;
    for (int i = 1; i * i <= area; i++) {
      if (i * i != area)
        while (area % i == 0 && tong[i] >= 2 && tong[area / i] >= 2) {
          res++;
          tong[i] -= 2;
          tong[area / i] -= 2;
        }
      else
        while (area % i == 0 && tong[i] >= 4) {
          res++;
          tong[i] -= 4;
        }
    }
    if (res == n)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
