#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 */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, unsigned int *);
main() {
  unsigned t, n, l, s[100], i;
  for (scanf("%u", &t); t--;) {
    scanf("%u", &n);
    for (l = 0; n; s[l++] = n % 2, n /= 2)
      ;
    for (i = 0; i < l / 2; i++)
      if (s[i] != s[l - i - 1])
        break;
    puts((i < l / 2) ? "NO" : "YES");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1232 <main+0x112>
lea    0xea3(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     11a4 <main+0x84>
jmp    117c <main+0x5c>
mov    -0xc(%rbp),%ecx
and    $0x1,%ecx
mov    -0x10(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
mov    %eax,%eax
mov    %ecx,-0x1a0(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116d <main+0x4d>
movl   $0x0,-0x1a4(%rbp)
mov    -0x1a4(%rbp),%eax
mov    -0x10(%rbp),%ecx
shr    $0x1,%ecx
cmp    %ecx,%eax
jae    1208 <main+0xe8>
mov    -0x1a4(%rbp),%eax
mov    -0x1a0(%rbp,%rax,4),%eax
mov    -0x10(%rbp),%ecx
sub    -0x1a4(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
cmp    -0x1a0(%rbp,%rcx,4),%eax
je     11ef <main+0xcf>
jmp    1208 <main+0xe8>
jmp    11f4 <main+0xd4>
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
jmp    11ae <main+0x8e>
mov    -0x1a4(%rbp),%ecx
mov    -0x10(%rbp),%edx
shr    $0x1,%edx
lea    0xdeb(%rip),%rdi
lea    0xde1(%rip),%rax
cmp    %edx,%ecx
cmovb  %rax,%rdi
call   1030 <puts@plt>
jmp    1142 <main+0x22>
mov    -0x4(%rbp),%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1a0,%rsp
lea    0xec9(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
subl   $0x1,0xc(%rsp)
jae    115b <main+0x3b>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
lea    0xe9e(%rip),%r14
lea    0x8(%rsp),%r15
lea    0xe98(%rip),%r13
lea    0xe8e(%rip),%r12
jmp    118c <main+0x6c>
mov    %r12,%rdi
nopw   0x0(%rax,%rax,1)
call   1030 <puts@plt>
subl   $0x1,0xc(%rsp)
jb     1148 <main+0x28>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    0x8(%rsp),%edx
mov    %r13,%rdi
test   %edx,%edx
je     1180 <main+0x60>
mov    $0x1,%edi
xor    %esi,%esi
nopl   0x0(%rax)
mov    %edx,%ebx
mov    %rsi,%rax
mov    %rdi,%rcx
mov    %edx,%edi
and    $0x1,%edi
add    $0x1,%rsi
mov    %edi,0x10(%rsp,%rax,4)
shr    %edx
lea    0x1(%rcx),%rdi
cmp    $0x2,%ebx
jae    11b0 <main+0x90>
mov    %edx,0x8(%rsp)
mov    %r13,%rdi
test   $0xfffffffe,%esi
je     1180 <main+0x60>
shr    %rcx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x10(%rsp,%rdx,4),%esi
mov    %eax,%edi
cmp    0x10(%rsp,%rdi,4),%esi
jne    1177 <main+0x57>
add    $0x1,%rdx
add    $0xffffffffffffffff,%rax
cmp    %rdx,%rcx
jne    11f0 <main+0xd0>
mov    %r13,%rdi
jmp    1180 <main+0x60>

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
@.str.1 = [3 x i8] c"NO\00"
@.str.2 = [4 x i8] c"YES\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [100 x i32]
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %8
8: ; preds = %51, %0
%9 = load i32, i32* %2
%10 = add i32 %9, -1
store i32 %10, i32* %2
%11 = icmp ne i32 %9, 0
br i1 %11, label %12, label %59
12: ; preds = %8
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
store i32 0, i32* %4
br label %14
14: ; preds = %18, %12
%15 = load i32, i32* %3
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %27
17: ; preds = %14
br label %18
18: ; preds = %17
%19 = load i32, i32* %3
%20 = urem i32 %19, 2
%21 = load i32, i32* %4
%22 = add i32 %21, 1
store i32 %22, i32* %4
%23 = zext i32 %21 to i64
%24 = getelementptr inbounds [100 x i32], [100 x i32]* %5, i64 0, i64 %23
store i32 %20, i32* %24
%25 = load i32, i32* %3
%26 = udiv i32 %25, 2
store i32 %26, i32* %3
br label %14
27: ; preds = %14
store i32 0, i32* %6
br label %28
28: ; preds = %48, %27
%29 = load i32, i32* %6
%30 = load i32, i32* %4
%31 = udiv i32 %30, 2
%32 = icmp ult i32 %29, %31
br i1 %32, label %33, label %51
33: ; preds = %28
%34 = load i32, i32* %6
%35 = zext i32 %34 to i64
%36 = getelementptr inbounds [100 x i32], [100 x i32]* %5, i64 0, i64 %35
%37 = load i32, i32* %36
%38 = load i32, i32* %4
%39 = load i32, i32* %6
%40 = sub i32 %38, %39
%41 = sub i32 %40, 1
%42 = zext i32 %41 to i64
%43 = getelementptr inbounds [100 x i32], [100 x i32]* %5, i64 0, i64 %42
%44 = load i32, i32* %43
%45 = icmp ne i32 %37, %44
br i1 %45, label %46, label %47
46: ; preds = %33
br label %51
47: ; preds = %33
br label %48
48: ; preds = %47
%49 = load i32, i32* %6
%50 = add i32 %49, 1
store i32 %50, i32* %6
br label %28
51: ; preds = %46, %28
%52 = load i32, i32* %6
%53 = load i32, i32* %4
%54 = udiv i32 %53, 2
%55 = icmp ult i32 %52, %54
%56 = zext i1 %55 to i64
%57 = select i1 %55, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%58 = call i32 @puts(i8* %57)
br label %8
59: ; preds = %8
%60 = load i32, i32* %1
ret i32 %60
}

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