#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, x, i;
  long long int area;
  bool ok;
  cin >> t;
  while (t--) {
    ok = 1;
    cin >> n;
    n *= 4;
    vector<int> v(n);
    for (i = 0; i < n; ++i) cin >> v[i];
    sort(v.begin(), v.end());
    area = v[0] * v[n - 1];
    for (i = 0; i < n / 4; i++) {
      int st = i * 2, dr = n - st - 1;
      if (v[st] != v[st + 1] || v[dr] != v[dr - 1] || v[st] * v[dr] != area) {
        ok = 0;
        break;
      }
    }
    if (ok)
      cout << "YES";
    else
      cout << "NO";
    cout << '\n';
  }
  return 0;
}
