#include <bits/stdc++.h>
using namespace std;
int a[600];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int i, j, n, m, l, r, x, t;
  cin >> t;
  while (t--) {
    cin >> n;
    n *= 4;
    for (i = 0; i < n; i++) {
      cin >> a[i];
    }
    sort(a, a + n);
    for (i = 0, j = n - 1; i < j; i += 2, j -= 2) {
      if (i == 0) {
        l = a[i] * a[j];
      }
      if (a[i] == a[i + 1] && a[j] == a[j - 1] && (a[i] * a[j]) == l) {
        continue;
      } else {
        i = -1;
        break;
      }
    }
    if (i != -1) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  }
  return 0;
}
