#include <bits/stdc++.h>
using namespace std::chrono;
using namespace std;
long long int bit(string s) {
  long long int k = 1;
  long long int n = s.size();
  long long int num = 0;
  for (long long int i = n - 1; i >= 0; --i) {
    num += (s[i] - '0') * k;
    k *= 2;
  }
  return num;
}
bool sortbysec(const pair<long long int, long long int> &a,
               const pair<long long int, long long int> &b) {
  return (a.second < b.second);
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    long long int a[4 * n];
    for (int i = 0; i < 4 * n; ++i) {
      cin >> a[i];
    }
    sort(a, a + 4 * n);
    long long int area = a[0] * a[4 * n - 1];
    int count = 1;
    for (int i = 0; i < 4 * n; i += 2) {
      if (a[i] * a[4 * n - 1 - i] != area) {
        cout << "NO" << endl;
        count = 0;
        break;
      }
      if (a[i] != a[i + 1]) {
        cout << "NO" << endl;
        count = 0;
        break;
      }
      if (a[4 * n - 1 - i] != a[4 * n - 2 - i]) {
        cout << "NO" << endl;
        count = 0;
        break;
      }
    }
    if (count == 1) cout << "YES" << endl;
  }
  return 0;
}
