#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;
    map<int, int> mp;
    for (int i = 0; i < n; i++) {
      string str;
      cin >> str;
      for (int j = 0; j < str.length(); j++) {
        mp[str[j]]++;
      }
    }
    bool flag = false;
    for (auto x : mp) {
      if (x.second % n != 0) {
        flag = true;
        break;
      }
    }
    if (flag) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
    }
  }
  return 0;
}
