#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, flag = 0, i, j;
    cin >> n;
    string s[n];
    map<char, int> mp;
    for (i = 0; i < n; i++) {
      cin >> s[i];
    }
    for (i = 0; i < n; i++) {
      for (j = 0; j < s[i].size(); j++) {
        mp[s[i][j]]++;
      }
    }
    for (auto it = mp.begin(); it != mp.end(); it++) {
      if (it->second % n != 0) {
        flag = 1;
        break;
      }
    }
    if (flag == 1)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
}
