#include <bits/stdc++.h>
using namespace std;
inline void get(vector<long long> &arr, long long n) {
  long long a;
  for (long long i = 0; i < n; i++) {
    cin >> a;
    arr.push_back(a);
  }
}
inline void print(vector<long long> &arr, long long n) {
  for (long long i = 0; i < n; i++) cout << arr[i] << " ";
  cout << "\n";
  ;
}
int32_t 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;
    map<char, long long> store;
    for (long long i = (0); i < (n); ++i) {
      string s;
      cin >> s;
      for (long long j = (0); j < (s.size()); ++j) store[s[j]]++;
    }
    bool exist = true;
    for (auto i : store) {
      if (i.second % n != 0) {
        exist = false;
        break;
      }
    }
    if (exist)
      cout << "YES"
           << "\n";
    else
      cout << "NO"
           << "\n";
    ;
  }
  return 0;
}
