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