#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int q;
  cin >> q;
  while (q--) {
    int n;
    cin >> n;
    vector<long long> a(4 * n);
    for (int i = 0; i < 4 * n; i++) cin >> a[i];
    map<long long, long long> dp;
    for (auto i : a) {
      dp[i]++;
    }
    bool yes = 1;
    for (auto &i : dp) {
      if (i.second % 2) {
        yes = 0;
        break;
      }
      i.second /= 2;
    }
    if (yes == 0) {
      cout << "NO\n";
      continue;
    }
    long long area = (dp.begin()->first) * (dp.rbegin()->first);
    long long z = 0;
    for (auto i : dp) {
      if (area % i.first != 0) {
        yes = 0;
        break;
      }
      if (i.first == (area / i.first)) {
        if (i.second % 2) yes = 0;
        z += (i.second);
      } else {
        if (i.second != dp[(area / i.first)]) yes = 0;
        z += min(i.second, dp[area / i.first]);
      }
    }
    if (z != 2 * n) {
      yes = 0;
    }
    if (yes)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
