#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int z = 0; z < t; z++) {
    int n;
    cin >> n;
    string a[100000], x = {};
    int dem[100000];
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      x += a[i];
    }
    sort(x.begin(), x.end());
    dem[0] = 1;
    int k = 0;
    for (int i = 1; i < x.length(); i++) {
      if (x[i] == x[i - 1])
        dem[k]++;
      else {
        k++;
        dem[k] = 1;
      }
    }
    sort(dem, dem + k + 1);
    int j = 0;
    while (1) {
      if (dem[j] % n != 0) {
        cout << "NO" << endl;
        break;
      } else
        j++;
      if (j > k) {
        cout << "YES" << endl;
        break;
      }
    }
  }
}
