#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    map<char, int> symbols;
    for (int i = 0; i < n; i++) {
      string str;
      cin >> str;
      for (auto chr : str) {
        symbols[chr]++;
      }
    }
    bool isNice = true;
    for (auto it : symbols) {
      isNice = isNice & ((it.second % n) == 0);
    }
    if (isNice) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
