#include <bits/stdc++.h>
using namespace std;
int dx[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dy[] = {0, 1, 1, 1, 0, -1, -1, -1};
template <typename T>
void printV(vector<T> v) {
  for (int i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int arr[26]{};
    int x = n;
    while (n--) {
      string s;
      cin >> s;
      for (int i = 0; i < s.length(); i++) {
        arr[s[i] - 'a']++;
      }
    }
    int isPossible = 1;
    for (int i = 0; i < 26; i++) {
      if ((arr[i] % x) != 0) {
        isPossible = 0;
        break;
      }
    }
    if (isPossible) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
