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