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