#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    map<char, int> mp;
    int n, i, k, l, c = 0;
    cin >> n;
    k = n;
    while (n--) {
      string s;
      cin >> s;
      l = s.length();
      for (i = 0; i < l; i++) {
        mp[s[i]]++;
      }
    }
    for (auto i : mp) {
      if (i.second % k != 0) {
        c++;
        cout << "NO" << endl;
        break;
      }
    }
    if (c == 0) {
      cout << "YES" << endl;
    }
  }
  return 0;
}
