#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int q;
  cin >> q;
  for (int w = 1; w <= q; w++) {
    int n;
    cin >> n;
    map<char, int> map;
    for (int i = 1; i <= n; i++) {
      string st;
      cin >> st;
      for (int j = 0; j < st.length(); j++) {
        char ch = st[j];
        auto it = map.find(ch);
        if (it != map.end()) {
          it->second += 1;
        } else {
          map.insert({ch, 1});
        }
      }
    }
    int flag = 0;
    for (auto i : map) {
      if (i.second % n == 0)
        continue;
      else {
        flag = 1;
        break;
      }
    }
    if (flag == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
