#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> a(26, 0);
    string s[n];
    for (long long int i = 0; i < n; i++) cin >> s[i];
    for (long long int i = 0; i < n; i++) {
      for (long long int j = 0; j < s[i].size(); j++) {
        a[s[i][j] - 'a']++;
      }
    }
    bool flag = true;
    for (long long int i = 0; i < 26; i++) {
      if (a[i] % n != 0) {
        flag = false;
        break;
      }
    }
    if (flag)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
