#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  ;
  int t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    unordered_map<char, int> m;
    vector<string> v(n);
    string s;
    for (int i = 0; i < n; i++) cin >> v[i];
    for (int i = 0; i < n; i++) {
      s = v[i];
      for (int j = 0; j < s.size(); j++) m[s[j]]++;
    }
    int flag = 0;
    for (auto i : m) {
      if ((i.second % n) != 0) {
        flag = 1;
        break;
      }
    }
    if (flag)
      cout << "NO"
           << "\n";
    else
      cout << "YES"
           << "\n";
  }
}
