#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
int n, m;
int s[27] = {0};
int main() {
  int t;
  cin >> t;
  while (t--) {
    memset(s, 0, sizeof s);
    cin >> n;
    for (int i = 1; i <= n; i++) {
      string str;
      cin >> str;
      int len = str.length();
      for (int j = 0; j < len; j++) {
        s[str[j] - 'a']++;
      }
    }
    bool f1 = true;
    for (int i = 0; i < 27; i++) {
      if (s[i] % n) f1 = false;
    }
    if (f1)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
