#include <bits/stdc++.h>
using namespace std;
using pi = pair<int, int>;
using ll = long long;
using pll = pair<ll, ll>;
using pli = pair<ll, int>;
const int MOD = 998244353;
const ll INF = 1e18 + 7;
ll powmod(ll base, ll exp, const ll MOD) {
  ll ans = 1;
  while (exp) {
    if (exp & 1) ans = (ans * base) % MOD;
    base = (base * base) % MOD;
    exp >>= 1;
  }
  return ans;
}
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return (a * b) / gcd(a, b); }
ll modInverse(ll n, const ll p) { return powmod(n, p - 2, p); }
const int mxN = 2e5 + 1;
void test_case() {
  int n;
  cin >> n;
  vector<int> a(26);
  int k = n;
  while (n--) {
    string s;
    cin >> s;
    for (auto c : s) a[c - 'a']++;
  }
  for (int i = 0; i < 26; ++i) {
    if (a[i] % k != 0) {
      cout << "NO\n";
      return;
    }
  }
  cout << "YES\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int tt;
  cin >> tt;
  while (tt--) {
    test_case();
  }
  return 0;
}
