#include <bits/stdc++.h>
using namespace std;
const long long int N = 1e5 + 5;
long long int n, a[N];
void solve() {
  cin >> n;
  map<long long int, long long int> mp;
  for (long long int i = 1; i <= 4 * n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + 4 * n + 1);
  set<long long int> st;
  bool check = 1;
  for (long long int l = 1, r = 4 * n; l <= r; l += 2, r -= 2) {
    bool cur = (a[l] == a[l + 1]);
    bool cur2 = (a[r] == a[r - 1]);
    check &= cur;
    check &= cur2;
    if (!check) {
      break;
    }
    long long int area = a[l] * a[r];
    st.insert(area);
  }
  if (check and st.size() == 1) {
    cout << "YES" << '\n';
  } else {
    cout << "NO" << '\n';
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
