#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t) {
    int n;
    cin >> n;
    bool ok = true;
    vector<int> v(n * 4);
    map<int, int> mp;
    for (int i = 0; i < n * 4; i++) {
      cin >> v[i];
      mp[v[i]]++;
    }
    sort(v.begin(), v.end());
    int area = v[0] * v[n * 4 - 1];
    for (int i = 1; i < (n * 4) / 2; i++) {
      if ((v[i] * v[(n * 4) - 1 - i] != area)) {
        ok = false;
        break;
      }
    }
    for (auto x = mp.begin(); x != mp.end(); x++) {
      if (x->second % 2 != 0) {
        ok = false;
        break;
      }
    }
    if (ok == true)
      cout << "YES\n";
    else
      cout << "NO\n";
    t--;
  }
  return 0;
}
