#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    string s = "";
    string s1;
    for (int i = 0; i < n; i++) {
      cin >> s1;
      s = s + s1;
    }
    map<char, int> m;
    for (int i = 0; i < s.size(); i++) {
      m[s[i]]++;
    }
    int k = 0;
    for (int i = 0; i < s.size(); i++) {
      if (m[s[i]] % n != 0) {
        cout << "NO" << endl;
        k = 1;
        break;
      }
    }
    if (k == 0) {
      cout << "YES" << endl;
    }
  }
}
