#include <bits/stdc++.h>
using namespace std;
int main() {
  int tt;
  cin >> tt;
  while (tt--) {
    int n;
    cin >> n;
    map<int, int> mp;
    for (int i = 0; i < (int)(4 * n); i++) {
      int tmp;
      cin >> tmp;
      mp[tmp]++;
    }
    bool can = true;
    vector<int> g;
    for (auto q : mp) {
      if (q.second % 2 == 0) {
        for (int i = 0; i < q.second / 2; i++) {
          g.push_back(q.first);
        }
      } else {
        can = false;
        break;
      }
    }
    if (can) {
      int s = g[0] * g.back();
      for (int i = 1; i < g.size() / 2; i++) {
        if (s != g[i] * g[2 * n - 1 - i]) {
          can = false;
        }
      }
    }
    if (can)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
