#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
const long long INF = 1e18;
const int MAXN = 1e5 + 1;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int q;
  cin >> q;
  while (q--) {
    int n;
    cin >> n;
    int a[4 * n];
    for (auto &i : a) cin >> i;
    sort((a), (a) + (4 * n));
    vector<int> t;
    bool f = 1;
    for (int i = 0; i < 4 * n;) {
      if (i < 4 * n - 1 and a[i] == a[i + 1]) {
        t.push_back(a[i]);
        i += 2;
      } else {
        f = 0;
        break;
      }
    }
    f &= t.size() == 2 * n;
    int ar = -1;
    if (t.size()) ar = t[0] * t.back();
    for (int i = 1, j = 2 * n - 2; i < n and f; i++, j--)
      f &= t[i] * t[j] == ar;
    cout << (f ? "YES" : "NO") << '\n';
  }
  return 0;
}
