#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int T;
  cin >> T;
  while (T--) {
    int n;
    cin >> n;
    string s[n];
    for (int i = (0); i < (n); i++) {
      cin >> s[i];
    }
    unordered_map<char, int> u;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < (long long)(s[i]).size(); j++) {
        u[s[i][j]]++;
      }
    }
    int f = 0;
    for (auto x : u) {
      if (x.second % n != 0) {
        f = 1;
        break;
      }
    }
    if (f == 0) {
      cout << "YES"
           << "\n";
    } else {
      cout << "NO"
           << "\n";
    }
  }
  return 0;
}
