#include <bits/stdc++.h>
using namespace std;
void S_K_S() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int32_t main() {
  S_K_S();
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    map<char, long long> m;
    bool tg = true;
    for (long long i = 0; i < n; i++) {
      string s;
      cin >> s;
      for (long long i = 0; i < s.size(); i++) m[s[i]]++;
    }
    for (auto x : m) {
      if (x.second % n != 0) {
        tg = false;
        break;
      }
    }
    if (tg == true)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
