#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int lcm(int a, int b) { return a * (b / gcd(a, b)); }
vector<int> sieve(int n) {
  bool prime[n + 1];
  vector<int> primes;
  memset(prime, true, sizeof(prime));
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= n; i += p) {
        prime[i] = false;
      }
    }
  }
  for (int p = 2; p <= n; p++) {
    if (prime[p]) {
      primes.push_back(p);
    }
  }
  return primes;
}
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
int main() {
  int test;
  cin >> test;
  while (test--) {
    int n;
    cin >> n;
    map<char, int> mp;
    for (int i = 0; i < n; i++) {
      string s;
      cin >> s;
      for (int j = 0; j < s.length(); j++) {
        mp[s[j]]++;
      }
    }
    int flag = 0;
    for (auto itr = mp.begin(); itr != mp.end(); itr++) {
      if (itr->second % n != 0) {
        flag = 1;
        break;
      }
    }
    if (flag == 1) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
    }
  }
  return 0;
}
