#include <bits/stdc++.h>
using namespace std;
const int N = 450;
int n, a[N];
bool solve() {
  sort(a, a + n);
  int area = a[0] * a[n - 1];
  for (int i = 0; i * 2 < n; i += 2) {
    if (a[i] != a[i + 1] || a[n - i - 1] != a[n - i - 2]) {
      return false;
    }
    if (a[i] * a[n - i - 1] != area) {
      return false;
    }
  }
  return true;
}
int main() {
  int T;
  cin >> T;
  while (T--) {
    cin >> n;
    n *= 4;
    for (int i = 0; i < n; ++i) {
      scanf("%d", a + i);
    }
    printf("%s\n", solve() ? "YES" : "NO");
  }
  return 0;
}
