#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    map<char, long long> vec;
    string arr[n];
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
    }
    for (int i = 0; i < n; i++) {
      for (auto itr : arr[i]) {
        vec[itr]++;
      }
    }
    for (auto itr : vec) {
      if (itr.second % n != 0) {
        cout << "NO\n";
        goto end;
      }
    }
    cout << "YES\n";
  end:;
  }
}
