#include <bits/stdc++.h>
using namespace std;
long long int T = 1;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> T;
  while (T--) {
    long long int n, ans, u, mn, mx, mini, i, v, q, p, j, k, w, h, l, m, x, y,
        od = 0, total = 0, cc = 0, pp = 0, flag = 0, klag = 0, sum = 0;
    string s = "YES", s2 = "NO";
    cin >> n;
    n = 4 * n;
    long long int a[n - 1];
    for (i = 0; i <= n - 1; i += 1) {
      cin >> a[i];
    }
    cc = 1;
    sort(a, a + n);
    x = a[0] * a[n - 1];
    for (i = 0, j = n - 1; i < n / 2 && j >= n / 2; j--, i++) {
      if (i == j) {
        break;
      }
      if (a[i] != a[i + 1] && i % 2 == 0 && (i + 1) % 2 != 0) {
        flag = 1;
      }
      if (a[j] != a[j - 1] && j % 2 != 0 && (j - 1) % 2 == 0) {
        flag = 1;
      }
      if (a[i] * a[j] != x) {
        flag = 1;
        break;
      }
    }
    cout << ((flag == 1) ? s2 : s) << "\n";
  }
  return 0;
}
