#include <bits/stdc++.h>
using namespace std;
long long int power1(long long int a, long long int x) {
  if (x == 0)
    return 1;
  else if (x == 1)
    return a;
  else
    return (a * power1(a, x - 1));
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int q, c = 0;
  q = 1;
  cin >> q;
  while (q--) {
    long long int n, m, x, flag = 1;
    cin >> n;
    map<long long int, long long int> ma;
    long long int a[4 * n];
    for (long long int i = 0; i < 4 * n; i++) cin >> a[i], ma[a[i]]++;
    string s;
    sort(a, a + 4 * n);
    long long int ans = a[0] * a[4 * n - 1];
    for (long long int i = 0; i < 2 * n; i++) {
      if (a[i] * a[4 * n - 1 - i] != ans || ma[a[i]] & 1) {
        cout << "NO\n";
        flag = 0;
        break;
      }
    }
    if (flag) cout << "YES\n";
  }
  return 0;
}
