#include <bits/stdc++.h>
using namespace std;
const int N = 4e2 + 5;
int q, n, A[N];
int main() {
  scanf("%d", &q);
  while (q--) {
    scanf("%d", &n);
    n *= 4;
    for (int i = 0; i < n; ++i) scanf("%d", A + i);
    sort(A, A + n);
    bool tmm = 1;
    for (int i = 0; i < n; i += 2) {
      tmm = A[i] == A[i + 1];
      if (!tmm) break;
    }
    int target = A[0] * A[n - 1];
    for (int i = 0; i < n; i += 2) {
      tmm = tmm && A[i] * A[n - i - 1] == target;
    }
    if (tmm)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
