#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    unordered_map<char, long long> hash;
    for (long long i = 0; i < n; i++) {
      string s;
      cin >> s;
      for (long long j = 0; j < s.length(); j++) hash[s.at(j)]++;
    }
    bool f = true;
    for (auto i : hash) {
      if (i.second % n != 0) {
        f = false;
        break;
      }
    }
    if (f)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
