#include <bits/stdc++.h>
using namespace std;
int main() {
  int q = 0, n = 0, area, flag;
  scanf("%d\n", &q);
  for (int j = 0; j < q; j++) {
    flag = 0;
    area = 0;
    scanf("%d\n", &n);
    vector<int> v(4 * n);
    for (int i = 0; i < (4 * n); i++) {
      scanf("%d ", &v[i]);
    }
    sort(v.begin(), v.end());
    for (int i = 0; i < (4 * n); i += 2) {
      if ((v[i] != v[i + 1]) || (v[4 * n - i - 2] != v[4 * n - i - 1])) {
        flag = 1;
        break;
      }
      if (area == 0) area = v[i] * v[4 * n - i - 2];
      if (area != v[i] * v[4 * n - i - 2]) {
        flag = 1;
        break;
      }
    }
    if (flag == 0)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
