#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, i;
    cin >> n;
    int h = n * 4;
    vector<int> a(h, 0);
    for (i = 0; i < h; i++) {
      cin >> a[i];
    }
    sort(a.begin(), a.end());
    i = 0;
    int j = h - 1, f = 1;
    long int ar = 1, prev;
    while (i < j) {
      if (a[i] != a[i + 1] || (a[j] != a[j - 1])) {
        cout << "NO" << endl;
        f = 0;
        break;
      }
      ar = a[i] * a[j];
      if (i == 0) {
        prev = ar;
      }
      if (i != 0) {
        if (ar != prev) {
          cout << "NO" << endl;
          f = 0;
          break;
        }
      }
      i = i + 2;
      j = j - 2;
    }
    if (f) {
      cout << "YES" << endl;
    }
  }
  return 0;
}
