#include <bits/stdc++.h>
using namespace std;
const long double pi = acos(-1);
vector<long long> prime;
bool mark[100000000];
long long isprime(long long n) {
  if (n < 2) return 0;
  for (long long p = 2; p * p <= n; p++) {
    if (n % p == 0) return false;
  }
  return true;
}
long long vec[100001];
using namespace std;
long long fact(long long n) {
  if ((n == 0) || (n == 1))
    return 1;
  else
    return n * fact(n - 1);
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t, cnt = 0;
  long long i, a, ay, bx, by, c, cy, dx, dy, b, x, y, add = 0, j, k, p, r, R;
  string str;
  long long n, value = 0, sum = 0;
  long long q, l, m;
  int master, please;
  int mat;
  cin >> t;
  while (t--) {
    bool ok = true;
    sum = 0;
    cin >> n;
    m = n;
    map<char, int> mp;
    while (n--) {
      cin >> str;
      for (i = 0; i < str.size(); i++) {
        mp[str[i]]++;
      }
    }
    for (auto i : mp) {
      if (i.second % m != 0) {
        cout << "NO\n";
        ok = false;
        break;
      }
    }
    cout << endl;
    if (ok) {
      cout << "YES\n";
    }
  }
  return 0;
}
