#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i += 1) {
    int n;
    cin >> n;
    int a[4 * n];
    for (int j = 0; j < 4 * n; j += 1) {
      cin >> a[j];
    }
    sort(a, a + 4 * n);
    int f1 = 1;
    int f2 = 1;
    int ind = 0;
    while (ind < 4 * n) {
      if (a[ind] != a[ind + 1]) {
        f1 = 0;
        break;
      } else {
        ind += 2;
      }
    }
    ind = 0;
    int area = a[0] * a[4 * n - 1];
    while (ind < (4 * n - 1 - ind)) {
      if (a[ind] * a[4 * n - 1 - ind] != area) {
        f2 = 0;
        break;
      } else {
        ind += 1;
      }
    }
    if (f1 == 1 && f2 == 1)
      cout << "YES" << '\n';
    else
      cout << "NO" << '\n';
  }
  return 0;
}
