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