#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
const int MOD = 1000000007;
const char nl = '\n';
const int MX = 100001;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int test;
  cin >> test;
  while (test--) {
    int n;
    cin >> n;
    string second;
    map<char, int> make_pair;
    for (char i = 'a'; i <= 'z'; i++) {
      make_pair[i] = 0;
    }
    int u = second.size();
    bool x = true;
    for (int i = 0; i < n; i++) {
      cin >> second;
      for (int j = 0; j < second.size(); j++) {
        make_pair[second[j]]++;
      }
    }
    for (char i = 'a'; i <= 'z'; i++) {
      if (make_pair[i] % n != 0) {
        x = false;
      }
    }
    if (x) {
      cout << "YES" << nl;
    } else {
      cout << "NO" << nl;
    }
  }
  return 0;
}
