#include <bits/stdc++.h>
using namespace std;
bool compare(int a, int b) { return (a > b); }
int main() {
  int q;
  cin >> q;
  while (q--) {
    int n, f = 0;
    cin >> n;
    vector<int> v;
    v.resize(4 * n);
    for (int i = 0; i < 4 * n; i++) cin >> v[i];
    sort(v.begin(), v.end());
    int first = 0, second = 1, third = v.size() - 2, fourth = v.size() - 1;
    long long temp = v[first] * v[fourth];
    while (second < third) {
      if (v[first] == v[second] && v[third] == v[fourth] &&
          temp == v[first] * v[fourth]) {
        first += 2;
        second += 2;
        third -= 2;
        fourth -= 2;
      } else {
        f = 1;
        break;
      }
    }
    if (f)
      cout << "NO";
    else
      cout << "YES";
    cout << endl;
  }
  return 0;
}
