#include <bits/stdc++.h>
using namespace std;
void FAST() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
long long gcd(long long x, long long y) {
  if (x == 0) return y;
  return gcd(y % x, x);
}
long long powM(long long x, long long y, long long m) {
  long long ans = 1, r = 1;
  x %= m;
  while (r > 0 && r <= y) {
    if (r & y) {
      ans *= x;
      ans %= m;
    }
    r <<= 1;
    x *= x;
    x %= m;
  }
  return ans;
}
map<long long, long long> factorize(long long n) {
  map<long long, long long> ans;
  for (long long i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      ans[i]++;
      n /= i;
    }
  }
  if (n > 1) {
    ans[n]++;
    n = 1;
  }
  return ans;
}
int main() {
  FAST();
  int t;
  cin >> t;
  for (long long x = 0; x < t; x++) {
    int n;
    cin >> n;
    vector<char> l;
    for (long long i = 0; i < n; i++) {
      string s;
      cin >> s;
      for (long long j = 0; j < s.length(); j++) {
        l.push_back(s[j]);
      }
    }
    sort(l.begin(), l.end());
    int c = 0, d;
    for (long long i = 1; i < l.size(); i++) {
      if (l[i - 1] == l[i]) {
        c++;
      } else {
        if ((c + 1) % n == 0) {
          c = 0;
        } else {
          break;
        }
      }
    }
    if ((c + 1) % n == 0) {
      cout << "YES" << '\n';
    } else {
      cout << "NO" << '\n';
    }
  }
  return 0;
}
