#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 t, j, i, p, n;
  scanf("%d", &t);
  for (j = 0; j < t; j++) {
    int n;
    int k;
    scanf("%d %d", &n, &k);
    int a[n];
    p = 0;
    for (i = 0; i < n; i++) {
      scanf("%d", &a[i]);
      if (a[i] <= 0)
        p++;
    }
    if (p >= k)
      printf("NO\n");
    else
      printf("YES\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecd(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1234 <main+0x114>
lea    0xea5(%rip),%rdi
xor    %eax,%eax
lea    -0x1c(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x1c(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11f6 <main+0xd6>
mov    -0x38(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x38(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jg     11e3 <main+0xc3>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11e8 <main+0xc8>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    119f <main+0x7f>
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
jl     1213 <main+0xf3>
lea    0xdfd(%rip),%rdi
call   1030 <printf@plt>
jmp    121f <main+0xff>
lea    0xdf0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1148 <main+0x28>
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xecb(%rip),%rdi
lea    -0x30(%rbp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,-0x30(%rbp)
jle    11fe <main+0xde>
lea    0xeaf(%rip),%r13
xor    %r12d,%r12d
jmp    1189 <main+0x69>
nopl   0x0(%rax)
cmp    -0x34(%rbp),%r15d
lea    0xe9f(%rip),%rdi
lea    0xe94(%rip),%rax
cmovl  %rax,%rdi
call   1030 <puts@plt>
mov    -0x40(%rbp),%rsp
add    $0x1,%r12d
cmp    -0x30(%rbp),%r12d
jge    11fe <main+0xde>
xor    %r15d,%r15d
lea    0xe6d(%rip),%rdi
lea    -0x2c(%rbp),%rsi
lea    -0x34(%rbp),%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %rsp,-0x40(%rbp)
mov    -0x2c(%rbp),%eax
mov    %rsp,%rbx
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
cmpl   $0x0,-0x2c(%rbp)
jle    1160 <main+0x40>
xor    %r14d,%r14d
xor    %r15d,%r15d
nopw   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
xor    %eax,%eax
cmpl   $0x0,(%rbx)
setle  %al
add    %eax,%r15d
add    $0x1,%r14
movslq -0x2c(%rbp),%rax
add    $0x4,%rbx
cmp    %rax,%r14
jl     11d0 <main+0xb0>
jmp    1160 <main+0x40>
xor    %eax,%eax
lea    -0x28(%rbp),%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 = [6 x i8] c"%d %d\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
%9 = alloca i8*
%10 = alloca i64
store i32 0, i32* %1
%11 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %3
br label %12
12: ; preds = %53, %0
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %56
16: ; preds = %12
%17 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %7, i32* %8)
%18 = load i32, i32* %7
%19 = zext i32 %18 to i64
%20 = call i8* @llvm.stacksave()
store i8* %20, i8** %9
%21 = alloca i32, i64 %19
store i64 %19, i64* %10
store i32 0, i32* %5
store i32 0, i32* %4
br label %22
22: ; preds = %40, %16
%23 = load i32, i32* %4
%24 = load i32, i32* %7
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %43
26: ; preds = %22
%27 = load i32, i32* %4
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i32, i32* %21, i64 %28
%30 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %29)
%31 = load i32, i32* %4
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i32, i32* %21, i64 %32
%34 = load i32, i32* %33
%35 = icmp sle i32 %34, 0
br i1 %35, label %36, label %39
36: ; preds = %26
%37 = load i32, i32* %5
%38 = add nsw i32 %37, 1
store i32 %38, i32* %5
br label %39
39: ; preds = %36, %26
br label %40
40: ; preds = %39
%41 = load i32, i32* %4
%42 = add nsw i32 %41, 1
store i32 %42, i32* %4
br label %22
43: ; preds = %22
%44 = load i32, i32* %5
%45 = load i32, i32* %8
%46 = icmp sge i32 %44, %45
br i1 %46, label %47, label %49
47: ; preds = %43
%48 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %51
49: ; preds = %43
%50 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %51
51: ; preds = %49, %47
%52 = load i8*, i8** %9
br label %53
53: ; preds = %51
%54 = load i32, i32* %3
%55 = add nsw i32 %54, 1
store i32 %55, i32* %3
br label %12
56: ; preds = %12
ret i32 0
}

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