#include <bits/stdc++.h>
using namespace std;
void check(string s, int n1) {
  int freq[26];
  bool flag = false;
  int count = 0;
  memset(freq, 0, sizeof(freq));
  int n = s.length();
  for (int i = 0; i < s.length(); i++) freq[s[i] - 'a']++;
  for (int i = 0; i < 26; i++) {
    if (freq[i] % n1 == 0) {
      flag = true;
    } else {
      count++;
    }
  }
  if (count > 0) {
    cout << "NO" << endl;
  }
  if (flag == true) {
    if (count == 0) {
      cout << "YES" << endl;
    }
  }
}
int main() {
  int t;
  cin >> t;
  string s1;
  int n;
  int n1;
  while (t--) {
    s1 = " ";
    cin >> n;
    n1 = n;
    while (n--) {
      string s;
      cin >> s;
      s1 += s;
    }
    check(s1, n1);
  }
  return 0;
}
