for i in range(int(raw_input())):
	cities = []
	n = int(raw_input())
	flag = 0
	
	for i in range(n):
		city = raw_input()
		name = city[0]
		if name in cities:
			flag = 1
		else:
			cities.append(name)
	if flag == 0:
		print "YES"
	else:
		print "NO"