#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 */
char getchar();
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *, ...);
int main() {
  int count;
  int a, k, i;
  scanf("%d", &count);
  char *answer[count];
  for (i = 0; i < count; i++) {
    scanf("%d %d", &a, &k);
    getchar();
    char c;
    char p = ' ';
    int on_time = 0;
    while ((c = getchar()) != '\n') {
      if ((c == '-' || c == '0') && p == ' ') {
        on_time++;
      }
      p = c;
    }
    if (k - on_time > 0)
      answer[i] = "YES";
    else
      answer[i] = "NO";
  }
  for (i = 0; i < count; i++)
    puts(answer[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xebd(%rip),%rdi
xor    %eax,%eax
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1251 <main+0x121>
lea    0xe6e(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1050 <scanf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
movb   $0x20,-0x2a(%rbp)
movl   $0x0,-0x30(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x29(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     1204 <main+0xd4>
movsbl -0x29(%rbp),%eax
cmp    $0x2d,%eax
je     11e3 <main+0xb3>
movsbl -0x29(%rbp),%eax
cmp    $0x30,%eax
jne    11f9 <main+0xc9>
movsbl -0x2a(%rbp),%eax
cmp    $0x20,%eax
jne    11f9 <main+0xc9>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x29(%rbp),%al
mov    %al,-0x2a(%rbp)
jmp    11b3 <main+0x83>
mov    -0x10(%rbp),%eax
sub    -0x30(%rbp),%eax
cmp    $0x0,%eax
jle    122b <main+0xfb>
mov    -0x38(%rbp),%rax
movslq -0x14(%rbp),%rcx
lea    0xde4(%rip),%rdx
mov    %rdx,(%rax,%rcx,8)
jmp    123e <main+0x10e>
mov    -0x38(%rbp),%rax
movslq -0x14(%rbp),%rcx
lea    0xdd0(%rip),%rdx
mov    %rdx,(%rax,%rcx,8)
jmp    1243 <main+0x113>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    117f <main+0x4f>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1283 <main+0x153>
mov    -0x38(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <puts@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1258 <main+0x128>
movl   $0x0,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%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    0xebb(%rip),%rdi
lea    -0x2c(%rbp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rsp,%r14
mov    -0x2c(%rbp),%eax
mov    %rsp,%r13
lea    0xf(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
cmpl   $0x0,-0x2c(%rbp)
jle    1247 <main+0x117>
mov    %r14,-0x38(%rbp)
lea    0xe87(%rip),%r14
xor    %r15d,%r15d
jmp    11b4 <main+0x84>
nopl   0x0(%rax,%rax,1)
cmp    %r12d,-0x30(%rbp)
mov    %r14,%rax
lea    0xe68(%rip),%rcx
cmovg  %rcx,%rax
mov    %rax,0x0(%r13,%r15,8)
add    $0x1,%r15
movslq -0x2c(%rbp),%rax
cmp    %rax,%r15
jge    121f <main+0xef>
lea    0xe45(%rip),%rdi
lea    -0x3c(%rbp),%rsi
lea    -0x30(%rbp),%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    $0x0,%r12d
cmp    $0xa,%al
je     1190 <main+0x60>
mov    $0x20,%cl
xor    %r12d,%r12d
nopw   0x0(%rax,%rax,1)
mov    %eax,%ebx
cmp    $0x2d,%al
sete   %al
cmp    $0x30,%bl
sete   %dl
or     %al,%dl
cmp    $0x20,%cl
sete   %al
and    %dl,%al
movzbl %al,%eax
add    %eax,%r12d
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %ebx,%ecx
cmp    $0xa,%al
jne    11f0 <main+0xc0>
jmp    1190 <main+0x60>
test   %eax,%eax
mov    -0x38(%rbp),%r14
jle    1247 <main+0x117>
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    0x0(%r13,%rbx,8),%rdi
call   1030 <puts@plt>
add    $0x1,%rbx
movslq -0x2c(%rbp),%rax
cmp    %rax,%rbx
jl     1230 <main+0x100>
mov    %r14,%rsp
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"YES\00"
@.str.3 = [3 x i8] c"NO\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
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)
%12 = load i32, i32* %2
%13 = zext i32 %12 to i64
%14 = call i8* @llvm.stacksave()
store i8* %14, i8** %6
%15 = alloca i8*, i64 %13
store i64 %13, i64* %7
store i32 0, i32* %5
br label %16
16: ; preds = %58, %0
%17 = load i32, i32* %5
%18 = load i32, i32* %2
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %61
20: ; preds = %16
%21 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4)
%22 = call signext i8 (...) @getchar()
store i8 32, i8* %9
store i32 0, i32* %10
br label %23
23: ; preds = %42, %20
%24 = call signext i8 (...) @getchar()
store i8 %24, i8* %8
%25 = sext i8 %24 to i32
%26 = icmp ne i32 %25, 10
br i1 %26, label %27, label %44
27: ; preds = %23
%28 = load i8, i8* %8
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 45
br i1 %30, label %35, label %31
31: ; preds = %27
%32 = load i8, i8* %8
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 48
br i1 %34, label %35, label %42
35: ; preds = %31, %27
%36 = load i8, i8* %9
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 32
br i1 %38, label %39, label %42
39: ; preds = %35
%40 = load i32, i32* %10
%41 = add nsw i32 %40, 1
store i32 %41, i32* %10
br label %42
42: ; preds = %39, %35, %31
%43 = load i8, i8* %8
store i8 %43, i8* %9
br label %23
44: ; preds = %23
%45 = load i32, i32* %4
%46 = load i32, i32* %10
%47 = sub nsw i32 %45, %46
%48 = icmp sgt i32 %47, 0
br i1 %48, label %49, label %53
49: ; preds = %44
%50 = load i32, i32* %5
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i8*, i8** %15, i64 %51
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %52
br label %57
53: ; preds = %44
%54 = load i32, i32* %5
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i8*, i8** %15, i64 %55
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %56
br label %57
57: ; preds = %53, %49
br label %58
58: ; preds = %57
%59 = load i32, i32* %5
%60 = add nsw i32 %59, 1
store i32 %60, i32* %5
br label %16
61: ; preds = %16
store i32 0, i32* %5
br label %62
62: ; preds = %72, %61
%63 = load i32, i32* %5
%64 = load i32, i32* %2
%65 = icmp slt i32 %63, %64
br i1 %65, label %66, label %75
66: ; preds = %62
%67 = load i32, i32* %5
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i8*, i8** %15, i64 %68
%70 = load i8*, i8** %69
%71 = call i32 @puts(i8* %70)
br label %72
72: ; preds = %66
%73 = load i32, i32* %5
%74 = add nsw i32 %73, 1
store i32 %74, i32* %5
br label %62
75: ; preds = %62
store i32 0, i32* %1
%76 = load i8*, i8** %6
%77 = load i32, i32* %1
ret i32 %77
}

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