#include <bits/stdc++.h>
using namespace std;
long double PI = 3.14159265358979323846;
const long long M = 1e9 + 7;
const long long inf = 1e18;
const long long ms = 1e7 + 2;
static int fastline = []() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  return 0;
}();
;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    n = 4 * n;
    int arr[n], i, j;
    for (i = 0; i < n; i++) {
      cin >> arr[i];
    }
    sort(arr, arr + n);
    int area = arr[0] * arr[n - 1];
    i = 0;
    j = n - 1;
    bool flag = true;
    while (i < j) {
      if ((arr[i] == arr[i + 1] && arr[j] == arr[j - 1]) &&
          (arr[i] * arr[j] == area)) {
        i += 2;
        j -= 2;
      } else {
        flag = false;
        break;
      }
    }
    if (flag) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  }
  return 0;
}
