#include <bits/stdc++.h>
using namespace std;
void Solve() {
  int n;
  cin >> n;
  map<char, int> M;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (int i = 0; i < s.size(); i++) {
      M[s[i]]++;
    }
  }
  for (auto i : M) {
    if (i.second % n != 0) {
      cout << "NO" << endl;
      return;
    }
  }
  cout << "YES" << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) Solve();
}
