#include <bits/stdc++.h>
using namespace std;
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n, i, j, alp[27] = {0}, flg = 1;
    cin >> n;
    string s[n + 1];
    for (i = 0; i < n; i++) cin >> s[i];
    for (i = 0; i < n; i++) {
      for (j = 0; j < s[i].size(); j++) {
        alp[s[i][j] * 1 - 96]++;
      }
    }
    for (i = 1; i < 27; i++) {
      if (alp[i] != 0) {
        if (alp[i] % n != 0) {
          flg = 0;
          break;
        }
      }
    }
    if (flg == 1)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
