#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
scalar_t__ setb(int);
int main() {
  int t, ele, res, x, i;
  scanf("%d", &t);
  while (t--) {
    res = 0;
    for (i = 0; i < 15; i++) {
      scanf("%d", &ele);
      res = (res ^ ele);
    }
    scanf("%d", &x);
    if (setb(res) > setb(x))
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     11f8 <main+0xc8>
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0xf,-0x18(%rbp)
jge    11a2 <main+0x72>
lea    0xe7e(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1171 <main+0x41>
lea    0xe57(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%edi
call   1040 <setb@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <setb@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jle    11e7 <main+0xb7>
lea    0xe26(%rip),%rdi
call   1030 <printf@plt>
jmp    11f3 <main+0xc3>
lea    0xe1a(%rip),%rdi
call   1030 <printf@plt>
jmp    114f <main+0x1f>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xebb(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1050 <scanf@plt>
subl   $0x1,0x10(%rsp)
jb     1299 <main+0x169>
lea    0xe9f(%rip),%rbx
lea    0xc(%rsp),%r14
lea    0x14(%rsp),%r15
lea    0xe94(%rip),%r12
lea    0xe8a(%rip),%r13
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
xor    0xc(%rsp),%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
xor    0xc(%rsp),%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
xor    0xc(%rsp),%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
xor    0xc(%rsp),%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
xor    0xc(%rsp),%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
xor    0xc(%rsp),%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
xor    0xc(%rsp),%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
xor    0xc(%rsp),%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
xor    0xc(%rsp),%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
xor    0xc(%rsp),%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
xor    0xc(%rsp),%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
xor    0xc(%rsp),%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
xor    0xc(%rsp),%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
xor    0xc(%rsp),%ebp
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
mov    %ebp,%edi
call   1040 <setb@plt>
mov    %rax,%rbp
mov    0x14(%rsp),%edi
call   1040 <setb@plt>
cmp    %rax,%rbp
mov    %r13,%rdi
cmovg  %r12,%rdi
call   1030 <puts@plt>
subl   $0x1,0x10(%rsp)
jae    1180 <main+0x50>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.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
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 = %35, %0
%9 = load i32, i32* %2
%10 = add nsw i32 %9, -1
store i32 %10, i32* %2
%11 = icmp ne i32 %9, 0
br i1 %11, label %12, label %36
12: ; preds = %8
store i32 0, i32* %4
store i32 0, i32* %6
br label %13
13: ; preds = %21, %12
%14 = load i32, i32* %6
%15 = icmp slt i32 %14, 15
br i1 %15, label %16, label %24
16: ; preds = %13
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%18 = load i32, i32* %4
%19 = load i32, i32* %3
%20 = xor i32 %18, %19
store i32 %20, i32* %4
br label %21
21: ; preds = %16
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
store i32 %23, i32* %6
br label %13
24: ; preds = %13
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%26 = load i32, i32* %4
%27 = call i64 @setb(i32 %26)
%28 = load i32, i32* %5
%29 = call i64 @setb(i32 %28)
%30 = icmp sgt i64 %27, %29
br i1 %30, label %31, label %33
31: ; preds = %24
%32 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %35
33: ; preds = %24
%34 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %35
35: ; preds = %33, %31
br label %8
36: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [3 x i8] c"NO\00"
@str.3 = [4 x i8] c"YES\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast 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 nsw i32 %8, -1
store i32 %9, i32* %1
%10 = icmp eq i32 %8, 0
br i1 %10, label %66, label %11
11: ; preds = %0, %11
%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 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%15 = load i32, i32* %2
%16 = xor i32 %15, %13
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%18 = load i32, i32* %2
%19 = xor i32 %18, %16
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%21 = load i32, i32* %2
%22 = xor i32 %21, %19
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%24 = load i32, i32* %2
%25 = xor i32 %24, %22
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%27 = load i32, i32* %2
%28 = xor i32 %27, %25
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%30 = load i32, i32* %2
%31 = xor i32 %30, %28
%32 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%33 = load i32, i32* %2
%34 = xor i32 %33, %31
%35 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%36 = load i32, i32* %2
%37 = xor i32 %36, %34
%38 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%39 = load i32, i32* %2
%40 = xor i32 %39, %37
%41 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%42 = load i32, i32* %2
%43 = xor i32 %42, %40
%44 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%45 = load i32, i32* %2
%46 = xor i32 %45, %43
%47 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%48 = load i32, i32* %2
%49 = xor i32 %48, %46
%50 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%51 = load i32, i32* %2
%52 = xor i32 %51, %49
%53 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%54 = load i32, i32* %2
%55 = xor i32 %54, %52
%56 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%57 = call i64 @setb(i32 %55)
%58 = load i32, i32* %3
%59 = call i64 @setb(i32 %58)
%60 = icmp sgt i64 %57, %59
%61 = select i1 %60, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0)
%62 = call i32 @puts(i8* dereferenceable(1) %61)
%63 = load i32, i32* %1
%64 = add nsw i32 %63, -1
store i32 %64, i32* %1
%65 = icmp eq i32 %63, 0
br i1 %65, label %66, label %11
66: ; preds = %11, %0
ret i32 0
}