#include <bits/stdc++.h>
using namespace std;
const int maxn = 505;
int a[maxn];
string solve(int n) {
  for (int i = 1; i <= 4 * n; i += 2) {
    if (a[i] != a[i + 1]) return "NO";
  }
  int s = a[1] * a[4 * n];
  for (int i = 1; i <= n; i++) {
    if (a[i * 2] * a[4 * n - i * 2 + 1] != s) return "NO";
  }
  return "YES";
}
int main() {
  int q, n;
  cin >> q;
  while (q--) {
    cin >> n;
    for (int i = 1; i <= 4 * n; i++) cin >> a[i];
    sort(a + 1, a + 1 + 4 * n);
    cout << solve(n) << endl;
  }
  return 0;
}
