#include <bits/stdc++.h>
using namespace std;
int arr[40];
int main() {
  int xxx, n;
  string s;
  cin >> xxx;
  for (int ttt = 0; ttt < xxx; ttt++) {
    bool flag = true;
    cin >> n;
    int z = n;
    while (z--) {
      cin >> s;
      for (int i = 0; i < s.size(); i++) arr[s[i] - 'a' + 1]++;
    }
    for (int i = 1; i < 27; i++)
      if (arr[i] % n != 0) {
        flag = false;
        break;
      }
    if (flag)
      cout << "YES\n";
    else
      cout << "NO\n";
    flag = true;
    for (int i = 0; i < 30; i++) arr[i] = 0;
  }
  return 0;
}
