#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, j, k, l, n;
  cin >> k;
  for (l = 0; l < k; l++) {
    string s;
    cin >> n;
    int c = 1;
    map<long long int, long long int> mp;
    map<long long int, long long int>::iterator it;
    for (i = 0; i < n; i++) {
      cin >> s;
      for (j = 0; j < s.size(); j++) {
        mp[s[j]]++;
      }
    }
    for (it = mp.begin(); it != mp.end(); it++) {
      if (it->second % n != 0) {
        c = 0;
        break;
      }
    }
    if (c == 1) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}
