#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    string second[n];
    long long first = 1;
    map<char, long long> m;
    for (long long i = 0; i < n; i++) {
      cin >> second[i];
      for (long long j = 0; j < second[i].length(); j++) {
        m[second[i][j]]++;
      }
    }
    for (auto i : m) {
      if (i.second % n != 0) {
        first = 0;
        break;
      }
    }
    if (first)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
