#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int cou[27] = {0};
    int n;
    cin >> n;
    getchar();
    char c;
    for (int i = 0; i < n; i++)
      while ((c = getchar()) != '\n') cou[c - 'a' + 1]++;
    int flag = 0;
    for (int k = 1; k <= 26; k++) {
      if (cou[k] && cou[k] % n != 0) {
        flag = 1;
        break;
      }
    }
    if (flag)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
  return 0;
}
