#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> s(4 * n);
    for (int i = 0; i < 4 * n; i++) {
      cin >> s[i];
    }
    sort(s.begin(), s.end());
    int ans = s[0] * s[4 * n - 1];
    bool flag = 0;
    for (int i = 1; i < 4 * n; i += 2) {
      if (ans != s[i] * s[4 * n - i - 1] || s[i] != s[i - 1] ||
          s[4 * n - i - 1] != s[4 * n - i]) {
        flag = 1;
        break;
      }
    }
    if (flag == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
