#include <bits/stdc++.h>
using namespace std;
string result(long long int alpha[], long long int n) {
  for (long long int i = 0; i < 26; i++) {
    if (alpha[i] % n != 0) return "NO";
  }
  return "YES";
}
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int alpha[26] = {0};
    for (long long int i = 0; i < n; i++) {
      string s;
      cin >> s;
      for (char a : s) alpha[a - 'a']++;
    }
    cout << result(alpha, n) << "\n";
  }
}
