#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int num[250];
int main() {
  int T;
  cin >> T;
  while (T--) {
    int n;
    cin >> n;
    memset(num, 0, sizeof(num));
    for (int i = 1; i <= n; i++) {
      string s;
      cin >> s;
      for (int i = 0; i < s.size(); i++) num[s[i] - 'A']++;
    }
    int ok = 1;
    for (int i = 0; i <= 100; i++) {
      if (num[i] % n != 0) {
        ok = 0;
        break;
      }
    }
    if (ok)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
