#include <bits/stdc++.h>
using namespace std;
int alpha[500];
char s[100100];
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    scanf("%d", &n);
    memset(alpha, 0, sizeof(alpha));
    for (int i = 1; i <= n; ++i) {
      scanf("%s", s);
      for (int j = 0; s[j]; ++j) alpha[s[j]]++;
    }
    int flag = 1;
    for (int i = 0; i <= 300; ++i) {
      if (alpha[i] % n) flag = 0;
    }
    if (flag)
      puts("YES");
    else
      puts("NO");
  }
}
