#include <bits/stdc++.h>
using namespace std;
int main() {
  int test;
  cin >> test;
  while (test--) {
    map<char, int> m;
    int n;
    cin >> n;
    int x = n;
    string s;
    while (n--) {
      cin >> s;
      for (int i = 0; i < s.length(); i++) m[s[i]]++;
    }
    int flag = 0;
    for (auto i : m) {
      if (i.second % x != 0) {
        flag = 1;
        break;
      }
    }
    if (flag == 1)
      cout << "NO"
           << "\n";
    else
      cout << "YES"
           << "\n";
  }
}
