#include <bits/stdc++.h>
using namespace std;
struct piii {
  long long first, second, th;
  bool operator<(const piii &b) {
    if (first != b.first) return first < b.first;
    if (second != b.second) return second < b.second;
    return th < b.th;
  }
};
int q, n, val;
int cnt[10005];
int main() {
  cout << setprecision(2) << fixed;
  ios::sync_with_stdio(false), cin.tie(0);
  cin >> q;
  while (q--) {
    memset(cnt, 0, sizeof(cnt));
    cin >> n;
    for (int i = 0; i < 4 * n; i++) {
      cin >> val;
      cnt[val]++;
    }
    bool ok = true;
    for (int i = 1; i <= 10000; i++)
      if (cnt[i] % 2 == 1) ok = false;
    if (ok) {
      int s = -1e9;
      for (int i = 1, j = 10000; i <= 10000; i++) {
        while (cnt[i] > 0) {
          cnt[i] -= 2;
          while (cnt[j] <= 0) j--;
          cnt[j] -= 2;
          if (s != -1e9 && i * j != s)
            ok = false;
          else
            s = i * j;
        }
      }
    }
    if (ok)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
