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