#include <bits/stdc++.h>
using namespace std;
bool cmp(int a, int b) { return a < b; }
int main() {
  int q, n, a[500];
  cin >> q;
  while (q--) {
    memset(a, 0, sizeof(a));
    cin >> n;
    for (int i = 0; i < 4 * n; ++i) {
      cin >> a[i];
    }
    sort(a, a + 4 * n, cmp);
    int ans = 0;
    int equal = a[0] * a[4 * n - 1];
    for (int i = 1; i < 2 * n; ++i) {
      if (i % 2 == 1) {
        if (a[i] != a[i - 1]) {
          cout << "NO" << endl;
          ans = 1;
          break;
        }
      }
      if (a[i] * a[4 * n - i - 1] != equal) {
        cout << "NO" << endl;
        ans = 1;
        break;
      }
    }
    if (ans == 0) {
      cout << "YES" << endl;
    }
  }
  return 0;
}
