#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, fl = 0;
    cin >> n;
    long long int a[26] = {0};
    for (long long int i = 0; i < n; i++) {
      string s;
      cin >> s;
      for (long long int j = 0; j < s.length(); j++) a[s[j] - 'a']++;
    }
    for (long long int i = 0; i < 26; i++) {
      if (a[i] != 0 && a[i] % n != 0) {
        fl = 1;
        break;
      }
    }
    if (fl == 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
