#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  while (T--) {
    int n;
    cin >> n;
    int temp = n;
    int arr[27] = {0};
    while (temp--) {
      string s;
      cin >> s;
      for (int i = 0; i < s.size(); i++) {
        if (s[i] >= 'A' && s[i] <= 'Z')
          arr[s[i] - 64]++;
        else
          arr[s[i] - 96]++;
      }
    }
    int flag = 0;
    for (int k = 1; k <= 26; k++) {
      if (arr[k] % n != 0) {
        flag = 1;
        break;
      }
    }
    if (flag == 1)
      cout << "NO" << '\n';
    else
      cout << "YES" << '\n';
  }
  return 0;
}
