#include <bits/stdc++.h>
using namespace std;
int t, n, A[26];
bool Possible;
string S;
int main() {
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    getchar();
    memset(A, 0, sizeof A);
    for (int i = 0; i < n; ++i) {
      getline(cin, S);
      for (int j = 0; j < int(S.size()); ++j) A[S[j] - 'a']++;
    }
    Possible = true;
    for (int i = 0; i < 26; ++i)
      if (A[i] % n != 0) Possible = false;
    if (Possible)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
