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