#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long tt;
  cin >> tt;
  while (tt--) {
    long long n;
    cin >> n;
    n *= 4;
    long long a[n];
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
    }
    bool ans = true;
    sort(a, a + n);
    long long area = a[0] * a[n - 1];
    for (long long i = 0; i < n / 2; i += 2) {
      if (a[i] * a[n - 1 - i] != area) ans = false;
      if (a[i] != a[i + 1] or a[n - 1 - i] != a[n - 2 - i]) ans = false;
    }
    if (ans)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
