#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[26] = {0};
    string tt;
    for (int i = 0; i < n; i++) {
      cin >> tt;
      for (int j = 0; j < tt.length(); j++) {
        a[tt[j] - 'a']++;
      }
    }
    int flag = 0;
    for (int i = 0; i < 26; i++) {
      if (a[i] % n != 0) {
        cout << "NO" << endl;
        flag = 1;
        break;
      }
    }
    if (!flag) {
      cout << "YES" << endl;
    }
  }
  return 0;
}
