#include <bits/stdc++.h>
using namespace std;
inline int qr() {
  int f = 0, fu = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') fu = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    f = (f << 3) + (f << 1) + c - 48;
    c = getchar();
  }
  return f * fu;
}
const int N = 1e3 + 10;
char a[N];
int n, T;
int cnt[26];
int main() {
  T = qr();
  while (T--) {
    n = qr();
    memset(cnt, 0, sizeof(cnt));
    for (register int i = 1; i <= n; ++i) {
      scanf("%s", a + 1);
      int len = strlen(a + 1);
      for (register int j = 1; j <= len; ++j) cnt[a[j] - 'a']++;
    }
    bool suc = true;
    for (register int i = 0; i <= 25; ++i)
      if (cnt[i] % n) {
        suc = false;
        break;
      }
    puts(suc ? "YES" : "NO");
  }
  return 0;
}
