#include <bits/stdc++.h>
using namespace std;
int main() {
  int q, n, i, j, area, ans_found;
  cin >> q;
  while (q--) {
    ans_found = 0;
    cin >> n;
    int a[4 * n];
    for (i = 0; i < 4 * n; i++) cin >> a[i];
    sort(a, a + 4 * n);
    for (i = 0; i < 4 * n - 1; i += 2) {
      if (a[i] != a[i + 1]) {
        cout << "NO\n";
        ans_found = 1;
        break;
      }
    }
    if (ans_found == 0) {
      area = a[0] * a[4 * n - 1];
      for (i = 2, j = 4 * n - 3; j > i; i += 2, j -= 2) {
        if (a[i] * a[j] != area) {
          cout << "NO";
          break;
        }
      }
      if (j < i) {
        cout << "YES";
      }
      cout << endl;
    }
  }
}
