#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<string> s(n);
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  bool x = 1;
  int fr[26] = {0};
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < s[i].size(); j++) {
      fr[s[i][j] - 'a']++;
    }
  }
  for (int i = 0; i < 26; i++) {
    if (fr[i] % n) {
      x = 0;
      break;
    }
  }
  if (x) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int T;
  cin >> T;
  while (T--) {
    solve();
  }
  return 0;
}
