#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    map<char, long long> cnt;
    bool ans = true;
    for (long long i = 0; i < n; ++i) {
      string tmp;
      cin >> tmp;
      for (long long j = 0; j < tmp.length(); ++j) {
        cnt[tmp[j]]++;
      }
    }
    for (long long i = 'a'; i <= 'z'; ++i) {
      if (cnt[char(i)] % n != 0) ans = false;
    }
    string out = (ans) ? "YES" : "NO";
    cout << out << endl;
  }
  return 0;
}
