'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
def print_yes_or_no(cities):
	start = 1
	city_dict = {}
	flag = False
	while start <= cities:
		city = raw_input().strip()
		if city_dict.get(city[0]) == None:
			city_dict[city[0]] = 1
		else:
			flag = True
		start = start + 1
	if flag == True:
		print "NO"
	else:
		print "YES"

if __name__ == '__main__':
	cases = int(raw_input())
	start = 1
	while start <= cases:
		cities = int(raw_input())
		print_yes_or_no(cities)
		start = start + 1