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