#include <bits/stdc++.h>
using namespace std;
unsigned long long int powz(int a, int b) {
  if (a == 0) return 0;
  if (b == 0) return 1;
  unsigned long long int temp = powz(a, b / 2);
  if (b % 2 == 0) {
    return ((temp % 1000000007) * (temp % 1000000007)) % 1000000007;
  } else {
    return ((a % 1000000007) * (temp % 1000000007) * (temp % 1000000007)) %
           1000000007;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    string str[n];
    for (int i = (int)0; i < (int)n; i++) {
      cin >> str[i];
    }
    long int arr[26] = {0};
    for (int i = (int)0; i < (int)n; i++) {
      for (int j = (int)0; j < (int)str[i].size(); j++) {
        arr[(int)str[i].at(j) - 97]++;
      }
    }
    bool ans = true;
    for (int i = (int)0; i < (int)26; i++) {
      if (arr[i] > 0) {
        if (arr[i] % n != 0) {
          ans = false;
          break;
        }
      }
    }
    if (ans == true)
      cout << "YES";
    else
      cout << "NO";
    cout << endl;
  }
}
