#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
const long double PI = acos(-1.0);
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int q;
  cin >> q;
  while (q--) {
    long long int n;
    cin >> n;
    vector<long long int> a(4 * n);
    for (long long int i = 0; i < 4 * n; i++) {
      cin >> a[i];
    }
    sort(a.begin(), a.end());
    queue<long long int> one, two;
    for (long long int i = 0; i < 2 * n; i++) {
      one.push(a[i]);
      two.push(a[4 * n - 1 - i]);
    }
    long long int pos = 1;
    long long int area = -1;
    for (long long int i = 0; i < n; i++) {
      if (area == -1) {
        long long int a = one.front();
        one.pop();
        long long int b = one.front();
        one.pop();
        long long int c = two.front();
        two.pop();
        long long int d = two.front();
        two.pop();
        if (a == b && c == d) {
          area = a * c;
        } else {
          pos = 0;
        }
      } else {
        long long int a = one.front();
        one.pop();
        long long int b = one.front();
        one.pop();
        long long int c = two.front();
        two.pop();
        long long int d = two.front();
        two.pop();
        if (a == b && c == d && area == a * c) {
          area = a * c;
        } else {
          pos = 0;
        }
      }
    }
    if (pos)
      cout << "YES" << '\n';
    else
      cout << "NO" << '\n';
  }
  return 0;
}
