#include <bits/stdc++.h>
using namespace std;
const int N = 107, M = 1e4 + 7;
int a[N << 2], cnt[M];
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    memset(cnt, 0, sizeof(cnt));
    int n, maxx = 0, minn = 1e9;
    cin >> n;
    n <<= 2;
    string s;
    for (int i = 0; i < n; ++i)
      cin >> a[i], ++cnt[a[i]], maxx = max(maxx, a[i]), minn = min(minn, a[i]);
    for (int i = minn; i <= maxx; ++i)
      if (cnt[i] & 1) {
        s = "NO\n";
        break;
      }
    if (s.empty()) {
      sort(a, a + n);
      int sq = a[0] * a[n - 1];
      for (int i = 0; i < n; ++i)
        if ((a[i] * a[n - i - 1]) ^ sq) {
          s = "NO\n";
          break;
        }
    }
    if (s.empty()) s = "YES\n";
    cout << s;
  }
  return 0;
}
