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