#include <bits/stdc++.h>
using namespace std;
int n, Q, a[405], cnt;
int main() {
  scanf("%d", &Q);
  while (Q--) {
    scanf("%d", &n);
    for (int i = 0; i < 4 * n; i++) scanf("%d", &a[i]);
    sort(a, a + 4 * n);
    cnt = 0;
    int k = a[0] * a[4 * n - 1];
    for (int i = 0; i < 4 * n; i = i + 2)
      if (a[i] * a[4 * n - 1 - i] != k || a[i] != a[i + 1]) cnt++;
    if (cnt > 0)
      puts("NO");
    else
      puts("YES");
  }
  return 0;
}
