#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 *, ...);
int main() {
  int i, j, t, n, k, a, count = 0;
  scanf("%d", &t);
  while (t--) {
    count = 0;
    scanf("%d%d", &n, &k);
    for (i = 0; i < n; i++) {
      scanf("%d", &a);
      if (a <= 0) {
        count++;
      }
    }
    if (count < k)
      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)
movl   $0x0,-0x20(%rbp)
lea    0xec5(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x10(%rbp)
cmp    $0x0,%eax
je     11f2 <main+0xd2>
movl   $0x0,-0x20(%rbp)
lea    0xe96(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11c4 <main+0xa4>
lea    0xe6f(%rip),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x0,-0x1c(%rbp)
jg     11b1 <main+0x91>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11b6 <main+0x96>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1180 <main+0x60>
mov    -0x20(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11e1 <main+0xc1>
lea    0xe2e(%rip),%rdi
call   1030 <printf@plt>
jmp    11ed <main+0xcd>
lea    0xe22(%rip),%rdi
call   1030 <printf@plt>
jmp    1148 <main+0x28>
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    0xecd(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
subl   $0x1,0xc(%rsp)
jae    1159 <main+0x39>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xea2(%rip),%r13
lea    0x10(%rsp),%rbx
lea    0xe9c(%rip),%rbp
lea    0xe92(%rip),%r14
jmp    1198 <main+0x78>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    0x14(%rsp),%r15d
mov    %r14,%rdi
cmovl  %rbp,%rdi
call   1030 <puts@plt>
subl   $0x1,0xc(%rsp)
jb     1148 <main+0x28>
lea    0xe61(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x14(%rsp),%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
mov    $0x0,%r15d
jle    1180 <main+0x60>
xor    %r15d,%r15d
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
xor    %eax,%eax
cmpl   $0x0,0x10(%rsp)
setle  %al
add    %eax,%r15d
add    $0x1,%r12d
cmp    0x8(%rsp),%r12d
jl     11d0 <main+0xb0>
jmp    1180 <main+0x60>

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

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