#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long sum = 1;
    long long sum1 = 0;
    long long sum2 = 0;
    long long cnt1 = 0;
    long long cnt2 = 0;
    long long res = 0;
    long long flag = 0;
    long long n;
    cin >> n;
    long long bm = n;
    string s;
    string su;
    while (n--) {
      cin >> s;
      su += s;
    }
    long long len = su.length();
    sort(su.begin(), su.end());
    for (long long i = 0; i < len - 1; i++) {
      if (su[i] == su[i + 1]) {
        sum += 1;
      } else {
        if (sum % bm == 0) {
          sum = 1;
        } else {
          cout << "NO" << endl;
          ;
          flag = 1;
          break;
        }
      }
    }
    if (sum % bm != 0 && flag == 0) {
      cout << "NO" << endl;
      ;
    } else if (flag == 0) {
      cout << "YES" << endl;
      ;
    }
  }
}
