#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 argc, char const *argv[]) {
  int t;
  scanf("%d\n", &t);
  int n;
  int k;
  int students_on_time;
  int late;
  for (int i_t = 0; i_t < t; i_t++) {
    scanf("%d %d\n", &n, &k);
    students_on_time = 0;
    for (int i_n = 0; i_n < n; i_n++) {
      scanf("%d", &late);
      if (late <= 0) {
        students_on_time++;
      }
    }
    if (students_on_time < k) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec6(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11ff <main+0xdf>
lea    0xe9e(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11c3 <main+0xa3>
lea    0xe75(%rip),%rdi
lea    -0x24(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x0,-0x24(%rbp)
jg     11b0 <main+0x90>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11b5 <main+0x95>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    117f <main+0x5f>
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11e0 <main+0xc0>
lea    0xe34(%rip),%rdi
call   1030 <printf@plt>
jmp    11ec <main+0xcc>
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
jmp    11f1 <main+0xd1>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%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    11e5 <main+0xc5>
lea    0xeb4(%rip),%r13
lea    0x10(%rsp),%rbx
lea    0xeab(%rip),%r14
xor    %r15d,%r15d
jmp    1193 <main+0x73>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    0x14(%rsp),%r12d
mov    %r14,%rdi
lea    0xe8e(%rip),%rax
cmovl  %rax,%rdi
call   1030 <puts@plt>
add    $0x1,%r15d
cmp    0xc(%rsp),%r15d
jge    11e5 <main+0xc5>
xor    %r12d,%r12d
lea    0xe63(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x14(%rsp),%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    1170 <main+0x50>
xor    %ebp,%ebp
xor    %r12d,%r12d
nopw   0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
xor    %eax,%eax
cmpl   $0x0,0x10(%rsp)
setle  %al
add    %eax,%r12d
add    $0x1,%ebp
cmp    0x8(%rsp),%ebp
jl     11c0 <main+0xa0>
jmp    1170 <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 = [4 x i8] c"%d\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [5 x i8] c"YES\0A\00"
@.str.4 = [4 x i8] c"NO\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %6)
store i32 0, i32* %11
br label %14
14: ; preds = %44, %2
%15 = load i32, i32* %11
%16 = load i32, i32* %6
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %47
18: ; preds = %14
%19 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %7, i32* %8)
store i32 0, i32* %9
store i32 0, i32* %12
br label %20
20: ; preds = %32, %18
%21 = load i32, i32* %12
%22 = load i32, i32* %7
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %35
24: ; preds = %20
%25 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %10)
%26 = load i32, i32* %10
%27 = icmp sle i32 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %24
%29 = load i32, i32* %9
%30 = add nsw i32 %29, 1
store i32 %30, i32* %9
br label %31
31: ; preds = %28, %24
br label %32
32: ; preds = %31
%33 = load i32, i32* %12
%34 = add nsw i32 %33, 1
store i32 %34, i32* %12
br label %20
35: ; preds = %20
%36 = load i32, i32* %9
%37 = load i32, i32* %8
%38 = icmp slt i32 %36, %37
br i1 %38, label %39, label %41
39: ; preds = %35
%40 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %43
41: ; preds = %35
%42 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %43
43: ; preds = %41, %39
br label %44
44: ; preds = %43
%45 = load i32, i32* %11
%46 = add nsw i32 %45, 1
store i32 %46, i32* %11
br label %14
47: ; preds = %14
ret i32 0
}

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