#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n;
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    vector<string> str(n);
    for (int i = 0; i < n; i++) cin >> str[i];
    int chars[26] = {0};
    for (int i = 0; i < n; i++)
      for (int j = 0; j < str[i].length(); j++) chars[str[i][j] - 'a']++;
    int first = 1;
    for (int i = 0; i < 26; i++)
      if (chars[i] % n != 0) {
        first = 0;
        break;
      }
    if (first)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
