#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e10 + 6;
const long long MOD = 1e9 + 7;
const long long mod = 998244353;
const int MX = 1e6 + 5;
const int LG = 25;
template <typename t>
void fff(const char* x, t&& val1) {
  cout << x << " : " << val1 << "\n";
}
template <typename t1, typename... t2>
void fff(const char* x, t1&& val1, t2&&... val2) {
  const char* xd = strchr(x + 1, ',');
  cout.write(x, xd - x) << " : " << val1 << " | ";
  fff(xd + 1, val2...);
}
long long a[MX];
long long b[MX];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long tc;
  cin >> tc;
  while (tc--) {
    long long n;
    cin >> n;
    map<char, long long> mapa;
    for (int i = 0; i < n; i++) {
      string a;
      cin >> a;
      for (int i = 0; i < a.size(); i++) {
        mapa[a[i]]++;
      }
    }
    long long flag = 0;
    for (auto xd : mapa) {
      if (xd.second % n != 0) flag = 1;
    }
    if (flag == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
