#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y, long long m) {
  long long r = 1;
  for (; y; y >>= 1) {
    if (y & 1) r = r * x % m;
    x = x * x % m;
  }
  return r;
}
const long long mod = 1e9 + 7;
int run_test() {
  int n;
  cin >> n;
  map<char, int> mp;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (int i = 0; i < s.length(); i++) {
      mp[s[i]]++;
    }
  }
  bool flag = false;
  for (auto x : mp) {
    if (x.second % n != 0) {
      flag = true;
      break;
    }
  }
  if (flag) {
    cout << "NO\n";
  } else {
    cout << "YES\n";
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  srand(time(NULL));
  ;
  long long t;
  t = 1;
  cin >> t;
  while (t--) {
    run_test();
  }
}
