#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 *);
scalar_t__ scanf(char *, int *, ...);
int main() {
  int cases, tstuds, rstuds, i = 0;
  scanf("%i", &cases);
  for (int a = 1; a <= cases && scanf("%i %i", &tstuds, &rstuds); a++) {
    int time;
    for (int b = 1; b <= tstuds && scanf("%i", &time); b++) {
      if (time <= 0)
        i++;
    }
    if (i == rstuds)
      printf("NO\n");
    else
      printf("YES\n");
    i = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xec6(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0x21(%rbp)
jg     1180 <main+0x60>
lea    0xe99(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1190 <main+0x70>
jmp    1238 <main+0x118>
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x22(%rbp)
jg     11c4 <main+0xa4>
lea    0xe54(%rip),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x22(%rbp)
mov    -0x22(%rbp),%al
test   $0x1,%al
jne    11d4 <main+0xb4>
jmp    11fa <main+0xda>
cmpl   $0x0,-0x1c(%rbp)
jg     11e7 <main+0xc7>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11ec <main+0xcc>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1197 <main+0x77>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1217 <main+0xf7>
lea    0xdf9(%rip),%rdi
call   1030 <printf@plt>
jmp    1223 <main+0x103>
lea    0xdec(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    114f <main+0x2f>
xor    %eax,%eax
add    $0x30,%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    0xece(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11ff <main+0xdf>
mov    $0x1,%ebp
lea    0x14(%rsp),%r12
lea    0xea6(%rip),%r13
lea    0x10(%rsp),%rbx
jmp    119a <main+0x7a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %r14d,%r14d
cmp    0x14(%rsp),%r14d
lea    0xe87(%rip),%rdi
lea    0xe84(%rip),%rax
cmove  %rax,%rdi
call   1030 <puts@plt>
lea    0x1(%rbp),%eax
cmp    0xc(%rsp),%ebp
mov    %eax,%ebp
jge    11ff <main+0xdf>
lea    0xe5f(%rip),%rdi
lea    0x8(%rsp),%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
test   %rax,%rax
je     11ff <main+0xdf>
cmpl   $0x0,0x8(%rsp)
jle    1170 <main+0x50>
xor    %r15d,%r15d
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
test   %rax,%rax
je     1173 <main+0x53>
xor    %eax,%eax
cmpl   $0x0,0x10(%rsp)
setle  %al
add    %eax,%r14d
add    $0x1,%r15d
cmp    0x8(%rsp),%r15d
jl     11d0 <main+0xb0>
jmp    1173 <main+0x53>
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"%i\00"
@.str.1 = [6 x i8] c"%i %i\00"
@.str.2 = [4 x i8] c"NO\0A\00"
@.str.3 = [5 x i8] c"YES\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 i32
store i32 0, i32* %1
store i32 0, i32* %5
%9 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 1, i32* %6
br label %10
10: ; preds = %48, %0
%11 = load i32, i32* %6
%12 = load i32, i32* %2
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4)
%16 = icmp ne i64 %15, 0
br label %17
17: ; preds = %14, %10
%18 = phi i1 [ false, %10 ], [ %16, %14 ]
br i1 %18, label %19, label %51
19: ; preds = %17
store i32 1, i32* %8
br label %20
20: ; preds = %36, %19
%21 = load i32, i32* %8
%22 = load i32, i32* %3
%23 = icmp sle i32 %21, %22
br i1 %23, label %24, label %27
24: ; preds = %20
%25 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %7)
%26 = icmp ne i64 %25, 0
br label %27
27: ; preds = %24, %20
%28 = phi i1 [ false, %20 ], [ %26, %24 ]
br i1 %28, label %29, label %39
29: ; preds = %27
%30 = load i32, i32* %7
%31 = icmp sle i32 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %29
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 1
store i32 %34, i32* %5
br label %35
35: ; preds = %32, %29
br label %36
36: ; preds = %35
%37 = load i32, i32* %8
%38 = add nsw i32 %37, 1
store i32 %38, i32* %8
br label %20
39: ; preds = %27
%40 = load i32, i32* %5
%41 = load i32, i32* %4
%42 = icmp eq i32 %40, %41
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %47
45: ; preds = %39
%46 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %47
47: ; preds = %45, %43
store i32 0, i32* %5
br label %48
48: ; preds = %47
%49 = load i32, i32* %6
%50 = add nsw i32 %49, 1
store i32 %50, i32* %6
br label %10
51: ; preds = %17
ret i32 0
}

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