#include <bits/stdc++.h>
using namespace std;
int a[10005];
vector<int> ans;
int main() {
  int q;
  cin >> q;
  while (q--) {
    ans.clear();
    bool flag = true;
    memset(a, 0, sizeof a);
    int n, num;
    cin >> n;
    for (int i = 0; i < 4 * n; i++) {
      cin >> num;
      a[num]++;
      if (a[num] % 2 == 0) {
        ans.push_back(num);
        a[num] -= 2;
      }
    }
    for (int i = 1; i <= 10000; i++) {
      if (a[i]) flag = false;
    }
    if (!flag) {
      cout << "NO" << endl;
      continue;
    } else {
      sort(ans.begin(), ans.end());
      int l = ans.size();
      int ant = ans[0] * ans[l - 1];
      for (int i = 1; i < l - 1; i++) {
        if (ans[i] * ans[l - 1 - i] != ant) flag = false;
      }
    }
    if (!flag)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
}
