#include <bits/stdc++.h>
using namespace std;
int main() {
  int Q;
  cin >> Q;
  while (Q--) {
    int n;
    cin >> n;
    map<int, int> mp;
    for (int i = 0; i < n * 4; i++) {
      int x;
      cin >> x;
      mp[x]++;
    }
    bool ok = true;
    for (auto &i : mp) {
      if (i.second % 2 != 0) {
        ok = false;
        break;
      }
      i.second /= 2;
    }
    deque<int> q;
    for (auto i : mp) {
      for (int j = 0; j < i.second; j++) {
        q.push_back(i.first);
      }
    }
    long long need = q.front() * q.back();
    q.pop_back();
    q.pop_front();
    while (ok && !q.empty()) {
      if (q.back() * q.front() != need) {
        ok = false;
        break;
      }
      q.pop_back();
      q.pop_front();
    }
    if (ok) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
