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