#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    map<int, int> m;
    vector<int> v;
    for (int i = 0; i < 4 * n; i++) {
      int x;
      cin >> x;
      m[x]++;
      if (m[x] % 2) v.push_back(x);
    }
    int flag = 1;
    for (auto i : m) {
      if (i.second % 2 == 1) {
        flag = 0;
        break;
      }
    }
    if (!flag) {
      cout << "NO" << endl;
      continue;
    }
    sort(v.begin(), v.end());
    int area = v[0] * v[v.size() - 1];
    for (int i = 1; i < v.size() / 2; i++) {
      if (v[i] * v[v.size() - 1 - i] != area) {
        flag = 0;
        break;
      }
    }
    if (flag)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
