#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
scalar_t__ scanf(char *, int *);
int /*<<< orphan*/ stdin;
int strlen(char *);
int main() {
  int n, m, i, u, doudou, L;
  char ar[9999], *p, *q;
  while (scanf("%d", &n) != EOF) {
    getchar();
    for (m = 1; m <= n; m++) {
      doudou = 1;
      fgets(ar, 9999, stdin);
      L = strlen(ar) - 1;
      p = ar;
      q = &ar[L - 1];
      for (i = 1; i <= L / 2; i++) {
        if (*q != *p) {
          doudou = 0;
          break;
        } else {
          p++;
          q--;
        }
      }
      if (doudou == 1)
        printf("yes\n");
      else
        printf("no\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2750,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe97(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
mov    0x2e67(%rip),%rcx
cmp    (%rcx),%rax
je     12c0 <main+0x170>
mov    $0x0,%al
call   1060 <getchar@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     12bb <main+0x16b>
movl   $0x1,-0x18(%rbp)
lea    -0x2730(%rbp),%rdi
mov    0x2e37(%rip),%rax
mov    (%rax),%edx
mov    $0x270f,%esi
call   1050 <fgets@plt>
lea    -0x2730(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
lea    -0x2730(%rbp),%rax
mov    %rax,-0x2738(%rbp)
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    -0x2730(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x2740(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x2744(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x2744(%rbp),%eax
cmp    %ecx,%eax
jg     1281 <main+0x131>
mov    -0x2740(%rbp),%rax
movsbl (%rax),%eax
mov    -0x2738(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     124a <main+0xfa>
movl   $0x0,-0x18(%rbp)
jmp    1281 <main+0x131>
mov    -0x2738(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x2738(%rbp)
mov    -0x2740(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x2740(%rbp)
jmp    1273 <main+0x123>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11fe <main+0xae>
cmpl   $0x1,-0x18(%rbp)
jne    129c <main+0x14c>
lea    0xd71(%rip),%rdi
call   1040 <printf@plt>
jmp    12a8 <main+0x158>
lea    0xd65(%rip),%rdi
call   1040 <printf@plt>
jmp    12ad <main+0x15d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1190 <main+0x40>
jmp    1162 <main+0x12>
xor    %eax,%eax
add    $0x2750,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2728,%rsp
lea    0xe98(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
mov    0x2e67(%rip),%rcx
cmp    (%rcx),%rax
jne    1192 <main+0x42>
xor    %eax,%eax
add    $0x2728,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2e4f(%rip),%r13
lea    0x10(%rsp),%r12
lea    0xe61(%rip),%rbp
lea    0xe57(%rip),%r14
jmp    11cd <main+0x7d>
xchg   %ax,%ax
lea    0xe49(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
mov    0x2e18(%rip),%rcx
cmp    (%rcx),%rax
je     117e <main+0x2e>
xor    %eax,%eax
call   1060 <getchar@plt>
cmpl   $0x0,0xc(%rsp)
jle    11b0 <main+0x60>
mov    $0x1,%r15d
jmp    1206 <main+0xb6>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0x1(%r15),%eax
cmp    0xc(%rsp),%r15d
mov    %eax,%r15d
jge    11b0 <main+0x60>
mov    0x0(%r13),%edx
mov    %r12,%rdi
mov    $0x270f,%esi
call   1050 <fgets@plt>
mov    %r12,%rdi
call   1040 <strlen@plt>
mov    %rbp,%rdi
cmp    $0x3,%eax
jl     11f3 <main+0xa3>
lea    -0x1(%rax),%ecx
shr    %ecx
add    $0xfffffffe,%eax
add    %rsp,%rax
add    $0x10,%rax
add    $0xffffffff,%ecx
add    $0x1,%rcx
xor    %edx,%edx
nop
movzbl (%rax),%ebx
cmp    0x10(%rsp,%rdx,1),%bl
jne    11f0 <main+0xa0>
add    $0xffffffffffffffff,%rax
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1240 <main+0xf0>
mov    %rbp,%rdi
jmp    11f3 <main+0xa3>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@stdin = global i32 0
@.str.1 = [5 x i8] c"yes\0A\00"
@.str.2 = [4 x i8] c"no\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [9999 x i8]
%9 = alloca i8*
%10 = alloca i8*
store i32 0, i32* %1
br label %11
11: ; preds = %67, %0
%12 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%13 = load i64, i64* @EOF
%14 = icmp ne i64 %12, %13
br i1 %14, label %15, label %68
15: ; preds = %11
%16 = call i32 (...) @getchar()
store i32 1, i32* %3
br label %17
17: ; preds = %64, %15
%18 = load i32, i32* %3
%19 = load i32, i32* %2
%20 = icmp sle i32 %18, %19
br i1 %20, label %21, label %67
21: ; preds = %17
store i32 1, i32* %6
%22 = getelementptr inbounds [9999 x i8], [9999 x i8]* %8, i64 0, i64 0
%23 = load i32, i32* @stdin
%24 = call i32 @fgets(i8* %22, i32 9999, i32 %23)
%25 = getelementptr inbounds [9999 x i8], [9999 x i8]* %8, i64 0, i64 0
%26 = call i32 @strlen(i8* %25)
%27 = sub nsw i32 %26, 1
store i32 %27, i32* %7
%28 = getelementptr inbounds [9999 x i8], [9999 x i8]* %8, i64 0, i64 0
store i8* %28, i8** %9
%29 = load i32, i32* %7
%30 = sub nsw i32 %29, 1
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [9999 x i8], [9999 x i8]* %8, i64 0, i64 %31
store i8* %32, i8** %10
store i32 1, i32* %4
br label %33
33: ; preds = %53, %21
%34 = load i32, i32* %4
%35 = load i32, i32* %7
%36 = sdiv i32 %35, 2
%37 = icmp sle i32 %34, %36
br i1 %37, label %38, label %56
38: ; preds = %33
%39 = load i8*, i8** %10
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = load i8*, i8** %9
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = icmp ne i32 %41, %44
br i1 %45, label %46, label %47
46: ; preds = %38
store i32 0, i32* %6
br label %56
47: ; preds = %38
%48 = load i8*, i8** %9
%49 = getelementptr inbounds i8, i8* %48, i32 1
store i8* %49, i8** %9
%50 = load i8*, i8** %10
%51 = getelementptr inbounds i8, i8* %50, i32 -1
store i8* %51, i8** %10
br label %52
52: ; preds = %47
br label %53
53: ; preds = %52
%54 = load i32, i32* %4
%55 = add nsw i32 %54, 1
store i32 %55, i32* %4
br label %33
56: ; preds = %46, %33
%57 = load i32, i32* %6
%58 = icmp eq i32 %57, 1
br i1 %58, label %59, label %61
59: ; preds = %56
%60 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %63
61: ; preds = %56
%62 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %63
63: ; preds = %61, %59
br label %64
64: ; preds = %63
%65 = load i32, i32* %3
%66 = add nsw i32 %65, 1
store i32 %66, i32* %3
br label %17
67: ; preds = %17
br label %11
68: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@stdin = global i32 0
@str = [3 x i8] c"no\00"
@str.3 = [4 x i8] c"yes\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9999 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [9999 x i8], [9999 x i8]* %2, i64 0, i64 0
%5 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %47, label %12
8: ; preds = %41, %12
%9 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = load i64, i64* @EOF
%11 = icmp eq i64 %9, %10
br i1 %11, label %47, label %12
12: ; preds = %0, %8
%13 = call i32 (...) @getchar()
%14 = load i32, i32* %1
%15 = icmp slt i32 %14, 1
br i1 %15, label %8, label %16
16: ; preds = %12, %41
%17 = phi i32 [ %44, %41 ], [ 1, %12 ]
%18 = load i32, i32* @stdin
%19 = call i32 @fgets(i8* %4, i32 9999, i32 %18)
%20 = call i32 @strlen(i8* %4)
%21 = icmp slt i32 %20, 3
br i1 %21, label %41, label %22
22: ; preds = %16
%23 = add nsw i32 %20, -1
%24 = lshr i32 %23, 1
%25 = add nsw i32 %20, -2
%26 = zext i32 %25 to i64
%27 = getelementptr inbounds [9999 x i8], [9999 x i8]* %2, i64 0, i64 %26
%28 = add nsw i32 %24, -1
%29 = zext i32 %28 to i64
%30 = getelementptr [9999 x i8], [9999 x i8]* %2, i64 0, i64 %29
br label %31
31: ; preds = %22, %37
%32 = phi i8* [ %39, %37 ], [ %27, %22 ]
%33 = phi i8* [ %38, %37 ], [ %4, %22 ]
%34 = load i8, i8* %32
%35 = load i8, i8* %33
%36 = icmp eq i8 %34, %35
br i1 %36, label %37, label %41
37: ; preds = %31
%38 = getelementptr inbounds i8, i8* %33, i64 1
%39 = getelementptr inbounds i8, i8* %32, i64 -1
%40 = icmp eq i8* %33, %30
br i1 %40, label %41, label %31
41: ; preds = %31, %37, %16
%42 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0), %16 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0), %37 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0), %31 ]
%43 = call i32 @puts(i8* dereferenceable(1) %42)
%44 = add nuw nsw i32 %17, 1
%45 = load i32, i32* %1
%46 = icmp slt i32 %17, %45
br i1 %46, label %16, label %8
47: ; preds = %8, %0
ret i32 0
}