#include <bits/stdc++.h>
using namespace std;
char kalimat[1005];
long long isi[30];
int main() {
  long long tc, i, j, banyak, len, k, benar;
  scanf("%lld", &tc);
  getchar();
  for (i = 0; i < tc; i++) {
    scanf("%lld", &banyak);
    getchar();
    for (j = 0; j <= 26; j++) {
      isi[j] = 0;
    }
    for (j = 0; j < banyak; j++) {
      scanf("%s", kalimat);
      getchar();
      len = strlen(kalimat);
      for (k = 0; k < len; k++) {
        isi[kalimat[k] - 'a']++;
      }
    }
    benar = 0;
    for (j = 0; j < 26; j++) {
      if (isi[j] % banyak != 0) {
        benar = 1;
        break;
      }
    }
    if (benar == 1) {
      printf("NO\n");
    } else {
      printf("YES\n");
    }
  }
  return 0;
}
