#include <bits/stdc++.h>
using namespace std;
template <class T>
void read(T &x) {
  x = 0;
  char c = getchar();
  int ok = (c == '-');
  while (!isdigit(c)) c = getchar();
  while (isdigit(c)) x = x * 10 + c - 48, c = getchar();
  if (ok) x = -x;
}
template <class T>
void write(T &x) {
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
template <class T>
T max(T &a, T &b) {
  if (a < b) swap(a, b);
  return a;
}
template <class T>
T max(T &a, T &b, T &c) {
  return max(max(a, b), c);
}
template <class T>
T max(T &a, T &b, T c, T &d) {
  return max(max(a, b, c), d);
}
template <class T>
T min(T &a, T &b) {
  if (a > b) swap(a, b);
  return a;
}
template <class T>
T min(T &a, T &b, T &c) {
  return min(min(a, b), c);
}
template <class T>
T min(T &a, T &b, T &c, T &d) {
  return min(min(a, b, c), d);
}
int t, n;
string s;
int f[200];
int main() {
  cin >> t;
  while (t--) {
    fill(f, f + 200, 0);
    cin >> n;
    for (int k = 1; k <= n; k++) {
      cin >> s;
      for (auto i : s) f[i]++;
    }
    int ok = 0;
    for (int i = 'a'; i <= 'z'; i++)
      if (f[i] % n) {
        ok = 1;
        break;
      }
    if (!ok)
      cout << "YES" << '\n';
    else
      cout << "NO" << '\n';
  }
}
