#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n, len = 0, i = 0, f = 0, c = 0;
    cin >> n;
    long long a[26] = {0};
    long long zz = n;
    while (zz--) {
      string s;
      cin >> s;
      for (int i = 0; i < s.length(); i++) {
        a[s[i] - 'a']++;
      }
    }
    for (int i = 0; i < 26; i++) {
      if (a[i] % n == 0) {
        continue;
      } else {
        f = 1;
        break;
      }
    }
    if (f == 1)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
  return 0;
}
