#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<string> v;
    unordered_map<char, int> p;
    for (int i = 0; i < n; i++) {
      string s;
      cin >> s;
      v.push_back(s);
    }
    for (int i = 0; i < v.size(); i++) {
      string s = v[i];
      for (int i = 0; i < s.length(); i++) {
        p[s[i]] = p[s[i]] + 1;
      }
    }
    int flag = 0;
    for (auto i = p.begin(); i != p.end(); i++) {
      if (i->second < n || i->second % n != 0) {
        flag = 1;
        break;
      }
    }
    if (flag == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
