#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<string> v(n);
    for (int i = 0; i < n; i++) {
      cin >> v[i];
    }
    int a[26] = {0};
    for (auto s : v) {
      for (auto i : s) {
        a[i - 'a']++;
      }
    }
    int f = 0;
    for (int i = 0; i < 26; i++) {
      if (a[i] % n) {
        f = 1;
        break;
      }
    }
    if (f) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
    }
  }
}
