t=int(raw_input())
for i in range(t):
	m=raw_input()
	le=len(m)
	flag=1
	for j in range(le):
		for k in range(j+1,le):
			s=m[j:k+1]
			s=s[::-1]
			if m.find(s)==-1:
				flag=2
				break
		if(flag==2):
			break
	if flag==1:
		print "YES"
	else:
		print "NO"