#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    string s;
    int n;
    cin >> n;
    vector<int> v(26);
    for (int i = 0; i < n; i++) {
      int count = 0;
      string s;
      cin >> s;
      for (char ch : s) {
        ++v[ch - 'a'];
      }
    }
    bool t = true;
    for (int i = 0; i < 26; i++)
      if (v[i] % n != 0) {
        t = false;
        break;
      }
    cout << (t ? "YES" : "NO") << endl;
  }
  return 0;
}
