#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, a;
  cin >> t;
  while (t--) {
    cin >> n;
    n = 4 * n;
    vector<int> v(n);
    for (int i = 0; i < n; ++i) {
      cin >> v[i];
    }
    sort(v.begin(), v.end());
    vector<int> v2;
    bool can = true;
    for (int i = 0; i < n - 1; i += 2) {
      if (v[i] != v[i + 1]) {
        can = false;
        break;
      }
      v2.push_back(v[i]);
    }
    int otro = v2.size() - 2;
    int mult = v2[0] * v2[v2.size() - 1];
    for (int i = 1; i < n / 2 && can; ++i) {
      if (v2[i] * v2[otro] != mult) {
        can = false;
        break;
      }
      otro--;
    }
    if (can)
      cout << "YES" << endl;
    else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
