#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int n;
int a[N * 4];
int main() {
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    cin >> n;
    for (int i = 0; i < n * 4; i++) cin >> a[i];
    sort(a, a + n * 4);
    int flag = 1;
    for (int i = 1; i < n * 4; i += 2) {
      if (a[i] == a[i - 1])
        continue;
      else {
        flag = 0;
        break;
      }
    }
    if (flag) {
      if (n == 1)
        cout << "YES" << endl;
      else {
        int flag1 = 1;
        int ans = a[0] * a[n * 4 - 1];
        for (int i = 2, j = n * 4 - 3; j - i > 0; i += 2, j -= 2) {
          if (a[i] * a[j] == ans)
            continue;
          else {
            flag1 = 0;
            break;
          }
        }
        if (flag1)
          cout << "YES" << endl;
        else
          cout << "NO" << endl;
      }
    } else
      cout << "NO" << endl;
  }
  return 0;
}
