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