#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, fre[26];
    memset(fre, 0, sizeof(fre));
    bool ck = true;
    string s[1005];
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> s[i];
      int u = s[i].length();
      for (int l = 0; l < u; l++) {
        int d = s[i][l] - 'a';
        ++fre[d];
      }
    }
    for (int i = 0; i < 26; i++)
      if (fre[i] % n != 0) ck = false;
    if (ck)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
