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