#include <bits/stdc++.h>
using namespace std;
template <typename T = int>
T input() {
  T res;
  cin >> res;
  return res;
}
template <typename It>
void input_seq(It begin, It end, istream &in = cin) {
  generate(begin, end,
           input<typename remove_reference<decltype(*begin)>::type>);
}
template <class It>
void output(It begin, It end, ostream &out = cerr) {
  while (begin != end) {
    out << *(begin++) << ' ';
  }
  out << endl;
}
void solve() {
  int n = input();
  vector<int> a(4 * n);
  input_seq(a.begin(), a.end());
  map<int, int> cnt;
  for (int x : a) {
    ++cnt[x];
  }
  for (pair<int, int> x : cnt) {
    if (x.second % 2 == 1) {
      cout << "NO" << endl;
      return;
    }
  }
  sort(a.begin(), a.end());
  int s = -1;
  for (int l = 0, r = 4 * n - 1; l < r; l += 2, r -= 2) {
    if (s == -1) {
      s = a[l] * a[r];
    } else {
      if (s != a[l] * a[r]) {
        cout << "NO" << endl;
        return;
      }
    }
  }
  cout << "YES" << endl;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int q = input();
  while (q--) {
    solve();
  }
}
