#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long cnt[26] = {};
    for (long long i = 0; i < n; i++) {
      string s;
      cin >> s;
      for (auto x : s) cnt[x - 'a']++;
    }
    bool flag = true;
    for (long long i = 0; i < 26; i++) {
      if (cnt[i] % n != 0) flag = false;
    }
    if (flag)
      cout << "YES";
    else
      cout << "NO";
    cout << "\n";
  }
  return 0;
}
