#include <bits/stdc++.h>
using namespace std;
const long long MAX = 10e9;
const long long pi = 3.1415926535897933846;
long long n, t, m, k = 0, best = 0, len = 0, l, w, q, sum = 0, x, y = 0, z, i,
                   j, count = 0;
vector<long long> v;
vector<pair<long long, long long>> vp;
set<long long> sl;
unordered_map<long long, long long> u_map;
long long a[1000005];
long long b[1000005];
long long c[1000005];
string s;
void solve() {
  cin >> n;
  u_map.clear();
  k = 0;
  for (long long i = 0; i < n; i++) {
    cin >> s;
    for (long long j = 0; j < s.length(); j++) u_map[s[j] - 'a']++;
  }
  for (long long i = 0; i < 26; i++) {
    if (u_map[i] % n != 0) {
      k = 1;
      break;
    }
  }
  if (k == 0) {
    cout << "YES" << '\n';
  } else
    cout << "NO" << '\n';
}
int main() {
  { ios_base::sync_with_stdio(false); }
  {
    cin.tie(NULL);
    cout.tie(NULL);
  }
  cin >> t;
  while (t--) solve();
}
