#include <bits/stdc++.h>
using namespace std;
template <typename t>
t power(t a, t p) {
  if (p == 1 || p == 0) {
    return (p == 1) ? a : 1;
  }
  t temp = power(a, p / 2);
  temp = temp * temp;
  if (p & 1) {
    temp = temp * a;
  }
  return temp;
}
template <typename t>
t power(t a, t p, t M) {
  if (p == 1 || p == 0) {
    return (p == 1) ? a : 1;
  }
  t temp = power(a, p / 2);
  temp = (temp * temp) % M;
  if (p & 1) {
    temp = (temp * a) % M;
  }
  return temp;
}
long long int modularInv(long long int a, long long int M) {
  return power<long long int>(a, M - 2, M);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int T;
  cin >> T;
  while (T--) {
    long long n;
    cin >> n;
    int count[26] = {0};
    for (int i = 0; i < n; i++) {
      string s;
      cin >> s;
      for (auto x : s) {
        count[x - 'a']++;
      }
    }
    bool flag = true;
    for (int i = 0; i < 26; i++) {
      if (count[i] % n != 0) {
        flag = false;
        break;
      }
    }
    if (flag)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
