#include <bits/stdc++.h>
using namespace std;
long long int powmod(long long int a, long long int b) {
  long long int res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % (long long int)1e9 + 7;
    ;
    a = (a * a) % (long long int)1e9 + 7;
    ;
    b = b >> 1;
  }
  return res % (long long int)1e9 + 7;
  ;
}
void solve() {
  long long int n;
  cin >> n;
  vector<long long int> a(4 * n);
  vector<long long int> cnt(10001, 0);
  for (long long int i = 0; i < 4 * n; i++) {
    cin >> a[i];
    cnt[a[i]]++;
  }
  long long int chec = 0;
  for (long long int i = 1; i <= 10000; i++) {
    if (cnt[i] % 2 != 0) {
      chec = 1;
      break;
    }
  }
  if (chec == 1) {
    cout << "NO\n";
    return;
  }
  sort(a.begin(), a.end());
  long long int p = a[0] * a[4 * n - 1];
  for (long long int i = 0; i < 2 * n; i++) {
    if (a[i] * a[4 * n - 1 - i] != p) {
      chec = 1;
      break;
    }
  }
  if (chec == 1) {
    cout << "NO\n";
    return;
  }
  cout << "YES\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}
