#include <bits/stdc++.h>
template <typename T>
T pow(T a, T b, long long m) {
  T ans = 1;
  while (b > 0) {
    if (b % 2 == 1) ans = (ans * a) % m;
    b /= 2;
    a = (a * a) % m;
  }
  return ans % m;
}
using namespace std;
const long long N = 2e5 + 77;
string s;
void sol() {
  long long n;
  cin >> n;
  vector<long long> A(30, 0);
  for (long long(i) = (0); (i) < (n); (i)++) {
    cin >> s;
    for (long long(j) = (0); (j) < ((long long)s.size()); (j)++)
      A[s[j] - 'a']++;
  }
  for (long long(i) = (0); (i) < ((long long)A.size()); (i)++)
    if (A[i] % n != 0) {
      cout << "NO" << '\n';
      return;
    }
  cout << "YES" << '\n';
}
int32_t main() {
  long long t;
  cin >> t;
  while (t--) sol();
  return 0;
}
