#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int T;
  T = 1;
  cin >> T;
  while (T--) {
    int n, i, j, k = 0;
    cin >> n;
    int a[26];
    memset(a, 0, sizeof(a));
    for (int(i) = int(0); i < n; i++) {
      string s;
      cin >> s;
      for (int(i) = int(0); i < s.length(); i++) {
        a[s[i] - 'a']++;
      }
    }
    for (int(i) = int(0); i < 26; i++) {
      if (a[i] % n != 0) {
        k = 1;
        break;
      }
    }
    if (k)
      cout << "NO\n";
    else {
      cout << "YES\n";
    }
  }
}
