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