#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 7;
long long arr[maxn];
int vis[maxn];
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    int n;
    if (n == 1) {
      printf("YES\n");
      continue;
    }
    scanf("%d", &n);
    n *= 4;
    for (int i = 1; i <= n; i++) {
      scanf("%lld", &arr[i]);
    }
    sort(arr + 1, arr + n + 1);
    long long aver;
    int mark = 1;
    for (int i = 1, j = n - 1; i <= j; i += 2, j -= 2) {
      if (arr[i] != arr[i + 1] || arr[j] != arr[j + 1]) {
        mark = 0;
        break;
      }
      if (i == 1) {
        aver = arr[i] * arr[j];
      } else if (arr[i] * arr[j] != aver) {
        mark = 0;
        break;
      }
    }
    if (mark) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
  return 0;
}
