#include <bits/stdc++.h>
using namespace std;
const int MAX = 1000006;
const double eps = 1e-9;
const int INF = 0x3f3f3f3f;
int dx[] = {0, -1, 0, 1};
int dy[] = {-1, 0, 1, 0};
int setBit(int n, int k) { return n | (1 << k); }
int clearBit(int n, int k) { return n ^ (1 << k); }
bool checkBit(int n, int k) { return ((n & (1 << k)) == 0 ? false : true); }
map<char, int> counter;
void solution() {
  int n;
  scanf("%d", &n);
  counter.clear();
  for (int i = 1; i <= n; i++) {
    string str;
    cin >> str;
    for (int k = 0; k < str.size(); k++) {
      counter[str[k]]++;
    }
  }
  bool chk = true;
  for (auto it = counter.begin(); it != counter.end(); it++) {
    if (it->second % n != 0) {
      chk = false;
      break;
    }
  }
  if (chk)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
int main() {
  int t;
  scanf("%d", &t);
  while (t--) solution();
  return 0;
}
