#include <bits/stdc++.h>
using namespace std;
void read(int &num) {
  num = 0;
  register int c = getchar();
  bool isNegative = false;
  if (c == '-') {
    isNegative = true;
    c = getchar();
  }
  for (; (c > 47 && c < 58); c = getchar()) num = num * 10 + c - 48;
  if (isNegative) num *= -1;
}
void solve() {
  int n;
  vector<int> chars(26);
  cin >> n;
  char c;
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    for (int k = 0; k < s.length(); k++) {
      chars[s[k] - 'a']++;
    }
  }
  for (int i = 0; i < 26; i++) {
    if (chars[i] % n != 0) {
      puts("NO");
      return;
    }
  }
  puts("YES");
  return;
}
int main() {
  int t;
  ios::sync_with_stdio(false);
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
