#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    string str[n];
    for (auto &i : str) cin >> i;
    map<char, int> cnt;
    for (auto i : str) {
      for (auto j : i) cnt[j]++;
    }
    bool ok = 1;
    for (auto i : cnt) ok &= (i.second % n == 0);
    cout << (ok ? "YES" : "NO") << endl;
  }
  return 0;
}
