#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  long long n, k;
  long long rem = 0;
  while (t--) {
    cin >> n;
    n = n * 4;
    long long arr[n];
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
    }
    sort(arr, arr + n);
    bool flag = true;
    for (int i = 0; i < n; i += 2) {
      if (arr[i] != arr[i + 1]) {
        flag = false;
        break;
      }
    }
    if (flag) {
      long long area = arr[0] * arr[n - 1];
      for (int i = 1; i < (n - 1) / 2; i++) {
        if (area != (arr[i] * arr[n - 1 - i])) {
          flag = false;
          break;
        }
      }
      if (flag)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    } else
      cout << "NO" << endl;
  }
  return 0;
}
