#include <bits/stdc++.h>
using namespace std;
int main() {
  int q, n, index, area;
  bool flag;
  cin >> q;
  int a[400];
  int b[200];
  while (q) {
    memset(a, 0, sizeof(a));
    memset(b, 0, sizeof(b));
    cin >> n;
    for (int i = 0; i < 4 * n; i++) {
      cin >> a[i];
    }
    sort(a, a + 4 * n);
    index = 0;
    flag = true;
    for (int i = 0; i < 4 * n - 1; i++) {
      if (a[i] == a[i + 1]) {
        b[index] = a[i];
        index++;
        i++;
        continue;
      } else {
        cout << "NO" << endl;
        flag = false;
        break;
      }
    }
    if (!flag) {
      q--;
      continue;
    }
    area = b[0] * b[2 * n - 1];
    for (int i = 1; i < n; i++) {
      if (b[i] * b[2 * n - 1 - i] == area) {
        continue;
      } else {
        cout << "NO" << endl;
        flag = false;
        break;
      }
    }
    if (!flag) {
      q--;
      continue;
    }
    cout << "YES" << endl;
    q--;
  }
  return 0;
}
