#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 main() {
  int test, time;
  long int i, n, k, j, count;
  scanf("%d", &test);
  for (i = 1; i <= test; i++) {
    count = 0;
    scanf("%ld", &n);
    scanf("%ld", &k);
    for (j = 1; j <= n; j++) {
      scanf("%d", &time);
      if (time <= 0)
        count = count + 1;
    }
    if (count < k)
      printf("YES \n");
    else
      printf("NO \n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movq   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
cmp    %rcx,%rax
jg     121b <main+0xfb>
movq   $0x0,-0x38(%rbp)
lea    0xe9a(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe88(%rip),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movq   $0x1,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x20(%rbp),%rax
jg     11da <main+0xba>
lea    0xe5d(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x0,-0xc(%rbp)
jg     11c4 <main+0xa4>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    11c9 <main+0xa9>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    118e <main+0x6e>
mov    -0x38(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    11f9 <main+0xd9>
lea    0xe18(%rip),%rdi
call   1030 <printf@plt>
jmp    1205 <main+0xe5>
lea    0xe0d(%rip),%rdi
call   1030 <printf@plt>
jmp    120a <main+0xea>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1149 <main+0x29>
xor    %eax,%eax
add    $0x40,%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    0xecb(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,(%rsp)
jle    11fa <main+0xda>
mov    $0x1,%ebp
lea    0xeae(%rip),%r12
lea    0xea4(%rip),%r13
lea    0x4(%rsp),%rbx
jmp    119f <main+0x7f>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %r14d,%r14d
cmp    0x10(%rsp),%r14
lea    0xe88(%rip),%rdi
lea    0xe85(%rip),%rax
cmovl  %rax,%rdi
call   1030 <puts@plt>
lea    0x1(%rbp),%rax
movslq (%rsp),%rcx
cmp    %rcx,%rbp
mov    %rax,%rbp
jge    11fa <main+0xda>
mov    %r12,%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %r12,%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpq   $0x0,0x8(%rsp)
jle    1170 <main+0x50>
xor    %r15d,%r15d
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
xor    %eax,%eax
cmpl   $0x0,0x4(%rsp)
setle  %al
add    %rax,%r14
add    $0x1,%r15
cmp    0x8(%rsp),%r15
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"%d\00"
@.str.1 = [4 x i8] c"%ld\00"
@.str.2 = [6 x i8] c"YES \0A\00"
@.str.3 = [5 x i8] c"NO \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i32 0, i32* %1
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i64 1, i64* %4
br label %10
10: ; preds = %42, %0
%11 = load i64, i64* %4
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = icmp sle i64 %11, %13
br i1 %14, label %15, label %45
15: ; preds = %10
store i64 0, i64* %8
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %5)
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %6)
store i64 1, i64* %7
br label %18
18: ; preds = %30, %15
%19 = load i64, i64* %7
%20 = load i64, i64* %5
%21 = icmp sle i64 %19, %20
br i1 %21, label %22, label %33
22: ; preds = %18
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%24 = load i32, i32* %3
%25 = icmp sle i32 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %22
%27 = load i64, i64* %8
%28 = add nsw i64 %27, 1
store i64 %28, i64* %8
br label %29
29: ; preds = %26, %22
br label %30
30: ; preds = %29
%31 = load i64, i64* %7
%32 = add nsw i64 %31, 1
store i64 %32, i64* %7
br label %18
33: ; preds = %18
%34 = load i64, i64* %8
%35 = load i64, i64* %6
%36 = icmp slt i64 %34, %35
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %41
39: ; preds = %33
%40 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %41
41: ; preds = %39, %37
br label %42
42: ; preds = %41
%43 = load i64, i64* %4
%44 = add nsw i64 %43, 1
store i64 %44, i64* %4
br label %10
45: ; preds = %10
ret i32 0
}

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