#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long x = 0, f = 1;
  char ch = ' ';
  while (!isdigit(ch)) {
    ch = getchar();
    if (ch == '-') f = -1;
  }
  while (isdigit(ch)) x = (x << 3) + (x << 1) + (ch ^ 48), ch = getchar();
  return x * f;
}
int cnt[30], n, t;
int main() {
  cin >> t;
  while (t--) {
    memset(cnt, 0, sizeof(cnt));
    cin >> n;
    for (int i = 1; i <= n; i++) {
      char ch[1005];
      scanf("%s", ch);
      for (int i = 0; ch[i]; i++) {
        cnt[ch[i] - 'a']++;
      }
    }
    int ok = 0;
    for (int i = 0; i < 26; i++) {
      if (cnt[i] % n != 0) {
        cout << "NO" << endl;
        ok = 1;
        break;
      }
    }
    if (!ok) {
      cout << "YES" << endl;
    }
  }
}
