test_case = int(raw_input())

while test_case :
	
	input_string = raw_input();
	find_flag = False
	
	str_len = len(input_string)
	str_array = [input_string[0:index][::-1] for index in range(2,str_len+1)]
	
	for sub_str in str_array:
		if not sub_str in input_string:
			find_flag =True
	
	if find_flag:
		print 'NO'
	else:
		print 'YES'
		
	test_case = test_case -1