#include <bits/stdc++.h>
using namespace std;
int q, n, m;
int mp[10000];
string s;
bool win = true;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  cout.tie();
  cin >> q;
  while (q--) {
    cin >> n;
    for (int i = 1; i <= n; i++) {
      cin >> s;
      for (int ch : s) mp[ch]++;
    }
    for (int i = 'a'; i <= 'z'; i++)
      if (mp[i] % n != 0) win = false;
    if (!win)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
    memset(mp, 0, sizeof(mp));
    win = true;
  }
}
