for _ in range(input()):
	a=raw_input()
	i=0
	j=1
	l=len(a)
	flag=1
	while i<l:
		j=i+1
		while j<=l:
			compa=a[i:j]
			#print compa
			
			if compa[::-1] not in a:
				flag=5
				break
			j=j+1
		if flag==5:
			break
		i=i+1
		
	if flag==1:
		print "YES"
	else:
		print "NO"