#include <bits/stdc++.h>
using namespace std;
long long l, a, b, c, h, w, k, q, n;
string s;
int main() {
  cin >> q;
  while (q--) {
    cin >> n;
    vector<int> l(26, 0);
    for (int i = 0; i < n; i++) {
      cin >> s;
      for (int j = 0; j < s.size(); j++) {
        l[(int)s[j] - 97]++;
      }
    }
    for (int i = 0; i < 26; i++) {
      if (l[i] % n != 0) {
        b = 1;
        break;
      }
    }
    if (b == 1) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
    }
    b = 0;
  }
}
