#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int T;
  cin >> T;
  while (T--) {
    int n;
    cin >> n;
    vector<string> v(n);
    for (int i = 0; i < n; i++) cin >> v[i];
    map<char, int> mp;
    for (int i = 0; i < n; i++) {
      string s = v[i];
      for (int j = 0; j < s.size(); j++) {
        mp[s[j]]++;
      }
    }
    bool flag = 1;
    for (pair<int, int> p : mp) {
      if (p.second % n == 0) continue;
      flag = 0;
      break;
    }
    if (flag)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
