#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve() {
  map<char, int> m;
  std::vector<string> v;
  string s;
  int n, j;
  cin >> n;
  int temp = n;
  int ok = 1;
  int sum = 0;
  while (temp--) {
    cin >> s;
    v.push_back(s);
    sum += s.size();
  }
  for (auto x : v) {
    for (auto y : x) m[y]++;
  }
  for (auto x : m) {
    if (x.second % n != 0) {
      ok = 0;
      break;
    }
  }
  if (ok == 1)
    cout << "YES\n";
  else
    cout << "NO\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
}
