#include <bits/stdc++.h>
using namespace std;
int main() {
  int q, n;
  scanf("%d", &q);
  while (q--) {
    scanf("%d", &n);
    int v[4 * n];
    for (int i = 0; i < 4 * n; i++) scanf("%d", &v[i]);
    sort(v, v + 4 * n);
    bool f = false;
    for (int i = 1; i < 4 * n; i += 2)
      if (v[i] != v[i - 1]) f = true;
    for (int i = 1; i < 2 * n; i++) {
      if (v[i] * v[4 * n - i - 1] != v[i - 1] * v[4 * n - i]) f = true;
    }
    printf(f ? "NO\n" : "YES\n");
  }
}
