#include <bits/stdc++.h>
using namespace std;
int main() {
  int tt;
  cin >> tt;
  while (tt--) {
    int n;
    cin >> n;
    vector<int> a(n * 4);
    for (int i = 0; i < 4 * n; i++) {
      cin >> a[i];
    }
    bool flag = true;
    sort(a.begin(), a.end());
    for (int i = 0; i < 4 * n; i += 2) {
      if (a[i] != a[i + 1]) flag = false;
    }
    int area = a.front() * a.back();
    for (int i = 0, j = (n * 4) - 1; i < j; i += 2, j -= 2) {
      if ((a[i] * a[j]) != area) flag = false;
    }
    flag ? cout << "YES\n" : cout << "NO\n";
  }
}
