#include <bits/stdc++.h>
using namespace std;
const int oo = int(1e9);
const int64_t lloo = (int64_t)(1e18);
class Task {
 public:
  int n;
  vector<string> A;
  void solveOne(istream &in, ostream &out) {
    in >> n;
    A.resize(n + 1);
    unordered_map<char, int> count;
    for (int i = 1; i <= n; ++i) {
      in >> A[i];
      for (int j = 0; j < A[i].size(); ++j) {
        count[A[i][j]]++;
      }
    }
    for (auto &[key, value] : count) {
      if (value % n != 0) {
        cout << "NO" << '\n';
        return;
      }
    }
    cout << "YES" << '\n';
  }
  void solve(istream &in, ostream &out) {
    int t = 1;
    in >> t;
    while (t--) solveOne(in, out);
  }
};
auto main() -> int {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  Task solver;
  istream &in(cin);
  ostream &out(cout);
  solver.solve(in, out);
  return 0;
}
