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