#include <bits/stdc++.h>
using namespace std;
int main() {
  long long q;
  cin >> q;
  while (q--) {
    long long n;
    cin >> n;
    long long a[4 * n];
    for (long long i = 0; i < 4 * n; ++i) {
      cin >> a[i];
    }
    sort(a, a + 4 * n);
    bool ans = true;
    long long s = a[0] * a[4 * n - 1];
    for (long long i = 0; i < 4 * n - 1; i += 2) {
      ans = ans && (a[i] == a[i + 1] && a[4 * n - 1 - i] == a[4 * n - 2 - i] &&
                    a[i] * a[4 * n - 1 - i] == s);
    }
    if (ans) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  }
}
