#include <bits/stdc++.h>
using namespace std;
int alpha[125];
int main() {
  int n, t;
  bool Naz = true;
  string s;
  cin >> t;
  for (int k = 0; k < t; k++) {
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> s;
      for (int j = 0; j < s.size(); j++) alpha[s[j]] += 1;
    }
    for (int i = 0; i < 125; i++) {
      if (alpha[i] % n != 0) Naz = false;
      alpha[i] = 0;
    }
    if (Naz)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
    Naz = true;
  }
}
