#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<char> characters;
  int number;
  cin >> number;
  while (number--) {
    int n;
    cin >> n;
    int a[26] = {0};
    for (int i = 0; i < n; i++) {
      string s;
      cin >> s;
      for (int j = 0; j < s.length(); j++) {
        a[s[j] - 97]++;
      }
    }
    int flag = 0;
    for (int i = 0; i < 26; i++) {
      if (a[i] % n != 0) {
        flag = 1;
        break;
      }
    }
    if (flag == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
