#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  do {
    int n, i, j, f = 0;
    long long int ar;
    cin >> n;
    int a[4 * n];
    for (i = 0; i < 4 * n; i++) {
      cin >> a[i];
    }
    sort(a, a + 4 * n);
    ar = a[0] * a[4 * n - 1];
    for (i = 0, j = 4 * n - 1; i < j; i += 2, j -= 2) {
      if (a[i] * a[j] != ar || a[i] != a[i + 1] || a[j] != a[j - 1]) {
        f = 1;
        break;
      }
    }
    if (f == 0)
      cout << "YES";
    else
      cout << "NO";
    cout << endl;
    t--;
  } while (t > 0);
  return 0;
}
