#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    unordered_map<char, int> mp;
    int n;
    cin >> n;
    string arr[n];
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
      for (auto c : arr[i]) {
        mp[c]++;
      }
    }
    bool ok = true;
    for (auto p : mp) {
      if (p.second % n != 0) {
        ok = false;
        break;
      }
    }
    cout << ((ok) ? "YES\n" : "NO\n");
  }
  return 0;
}
