#include <bits/stdc++.h>
const long long int mod = 1000000007;
const long long int AM = 2e5 + 5;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    string s[n + 1];
    for (__typeof(0) i = 0; i < n; ++i) cin >> s[i];
    long long int cnt[200] = {0};
    for (__typeof(0) i = 0; i < n; ++i) {
      for (__typeof(0) j = 0; j < s[i].size(); ++j) {
        cnt[s[i][j] - 'a']++;
      }
    }
    long long int flag = 1;
    for (__typeof(0) i = 0; i < 26; ++i) {
      if (cnt[i] % n != 0) flag = 0;
    }
    if (flag)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
