#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  int cnt[10005] = {0};
  cin >> n;
  int a[405];
  for (int i = 0; i < 4 * n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < 4 * n; i++) {
    cnt[a[i]]++;
  }
  int s = 1, e = 10002;
  int area = -1;
  while (s <= e) {
    while (cnt[s] == 0) {
      s++;
    }
    while (cnt[e] == 0) {
      e--;
    }
    if (cnt[s] % 2 != 0 || cnt[e] % 2 != 0) {
      cout << "NO" << endl;
      return;
    }
    if (cnt[s] != cnt[e]) {
      cout << "NO" << endl;
      return;
    }
    if (area != -1) {
      if (s * e != area) {
        cout << "NO" << endl;
        return;
      }
    }
    area = s * e;
    s++;
    e--;
  }
  cout << "YES" << endl;
  return;
}
int main() {
  int t;
  scanf("%d", &t);
  for (int i = 0; i < t; i++) {
    solve();
  }
  return 0;
}
