#include <bits/stdc++.h>
using namespace std;
void init_code() {}
void solve() {
  int n;
  cin >> n;
  unordered_map<char, int> m;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (int j = 0; j < s.length(); j++) {
      m[s[j]]++;
    }
  }
  for (auto u : m) {
    int key = u.second;
    if (key % n != 0) {
      cout << "NO" << endl;
      return;
    }
  }
  cout << "YES" << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
