#include <bits/stdc++.h>
using namespace std;
int cnt[30];
int main() {
  cin.tie(0);
  cin.sync_with_stdio(0);
  int t;
  cin >> t;
  while (t--) {
    fill(cnt, cnt + 30, 0);
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
      string s;
      cin >> s;
      for (auto j : s) {
        cnt[j - 'a']++;
      }
    }
    int f = 1;
    for (int i = 0; i < 30; i++)
      if (cnt[i] % n) f = 0;
    if (f)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
