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