#include <bits/stdc++.h>
using namespace std;
int check(vector<int> array, int n) {
  int area = array[0] * 1ll * array.back();
  for (int i = 0; i < n; i++) {
    int f = (2 * i), r = 4 * n - (i * 2) - 1;
    if (array[f] != array[f + 1] || array[r] != array[r - 1] ||
        array[f] * 1ll * array[r] != area) {
      return 0;
    }
  }
  return 1;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int size = 4 * n;
    vector<int> array(size);
    for (int i = 0; i < size; i++) {
      cin >> array[i];
    }
    sort(array.begin(), array.end());
    if (check(array, n) == 1) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}
