#include <bits/stdc++.h>
using namespace std;
long long int ara[200010];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int w, h, n, t, x, a, b, l, r, f, i, j, p, d, k;
  string s;
  cin >> t;
  while (t--) {
    cin >> n;
    map<char, long long int> mp;
    map<char, long long int>::iterator it;
    for (j = 1; j <= n; j++) {
      cin >> s;
      for (i = 0; i < s.length(); i++) {
        mp[s[i]]++;
      }
    }
    f = 0;
    for (it = mp.begin(); it != mp.end(); it++) {
      a = it->second;
      if (a % n != 0) f = 1;
    }
    if (f == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
