#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 15;
int n, a[N];
bool solve() {
  cin >> n;
  for (int i = 0, ggd = 4 * n; i < ggd; i++) cin >> a[i];
  sort(a, a + 4 * n);
  deque<int> d;
  for (int i = 0, ggd = 4 * n; i < ggd; i++) d.push_back(a[i]);
  int val = -1;
  while (((int)(d).size())) {
    vector<int> v;
    v.push_back(d.front());
    d.pop_front();
    v.push_back(d.front());
    d.pop_front();
    v.push_back(d.back());
    d.pop_back();
    v.push_back(d.back());
    d.pop_back();
    if (v[0] != v[1]) return 0;
    if (v[2] != v[3]) return 0;
    if (val != -1 && val != v[0] * v[3]) return 0;
    val = v[0] * v[3];
  }
  return 1;
}
int main() {
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) cout << ((solve()) ? ("YES") : ("NO")) << endl;
}
