#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  cin >> q;
  while (q--) {
    int n;
    cin >> n;
    int a[4 * n];
    for (int i = 0; i < 4 * n; i++) {
      cin >> a[i];
    }
    sort(a, a + n);
    map<int, int> lol;
    int liko = 0;
    for (int i = 0; i < 4 * n; i++) {
      lol[a[i]]++;
      liko += (lol[a[i]] % 2 == 0 ? -1 : 1);
    }
    if (liko) {
      cout << "NO" << endl;
      continue;
    }
    vector<int> turim, kiek;
    for (auto i : lol) {
      turim.push_back(i.first);
      kiek.push_back(i.second);
    }
    bool flag1 = false;
    for (int pirmam = 0; pirmam < turim.size(); pirmam++) {
      bool flag = 1;
      int area = turim[0] * turim[pirmam];
      if (pirmam == 0 && kiek[0] % 4 != 0) {
        flag = 0;
        continue;
      } else if (pirmam == 0 && turim.size() == 1) {
        flag1 = 1;
      }
      for (int j = 1; j < turim.size(); j++) {
        if (area % turim[j] != 0) {
          flag = 0;
          continue;
        }
        if (lol[turim[j]] != lol[area / turim[j]]) {
          flag = 0;
          continue;
        }
      }
      flag1 |= flag;
    }
    cout << (flag1 ? "YES" : "NO") << endl;
  }
}
