t=input()
while(t>0):
    x=raw_input()
    y=len(x)
    c=0
    for i in range(int(y/2)):
        if(x[i]==x[y-i-1]):
            c+=1

    if(y%2==0):
        if(c==y/2):
            print("YES")
        else:
            print("NO")
    else:
        if(int(y/2)==c):
            print("YES")
        else:
            print("NO")
    t=t-1