#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;
  scanf("%d", &t);
  while (t--) {
    int j, n, k, x, count;
    scanf("%d%d", &n, &k);
    j = count = 0;
    while (j < n) {
      scanf("%d", &x);
      if (x % 2 == 0)
        ++count;
      ++j;
    }
    if (k == 0 && count == n)
      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    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecc(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     120d <main+0xed>
lea    0xea4(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11c2 <main+0xa2>
lea    0xe76(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11b4 <main+0x94>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1179 <main+0x59>
cmpl   $0x0,-0x14(%rbp)
jne    11df <main+0xbf>
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    11df <main+0xbf>
movl   $0xffffffff,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     11fc <main+0xdc>
lea    0xe13(%rip),%rdi
call   1030 <printf@plt>
jmp    1208 <main+0xe8>
lea    0xe07(%rip),%rdi
call   1030 <printf@plt>
jmp    1141 <main+0x21>
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    0xe99(%rip),%r14
lea    0xe95(%rip),%r15
jmp    11a8 <main+0x88>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x14(%rsp),%ecx
xor    %r12d,%eax
or     %ecx,%eax
mov    $0xffffffff,%eax
cmove  %eax,%r12d
cmp    %ecx,%r12d
mov    %r15,%rdi
cmovl  %r14,%rdi
call   1030 <puts@plt>
subl   $0x1,0xc(%rsp)
jb     1148 <main+0x28>
lea    0xe51(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x14(%rsp),%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
mov    $0x0,%r12d
test   %eax,%eax
jle    1180 <main+0x60>
xor    %r12d,%r12d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x10(%rsp),%eax
not    %eax
and    $0x1,%eax
add    %eax,%r12d
add    $0x1,%ebp
mov    0x8(%rsp),%eax
cmp    %eax,%ebp
jl     11e0 <main+0xc0>
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
store i32 0, i32* %1
%8 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %9
9: ; preds = %46, %0
%10 = load i32, i32* %2
%11 = add nsw i32 %10, -1
store i32 %11, i32* %2
%12 = icmp ne i32 %10, 0
br i1 %12, label %13, label %47
13: ; preds = %9
%14 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %5)
store i32 0, i32* %7
store i32 0, i32* %3
br label %15
15: ; preds = %27, %13
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %30
19: ; preds = %15
%20 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%21 = load i32, i32* %6
%22 = srem i32 %21, 2
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %19
%25 = load i32, i32* %7
%26 = add nsw i32 %25, 1
store i32 %26, i32* %7
br label %27
27: ; preds = %24, %19
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %15
30: ; preds = %15
%31 = load i32, i32* %5
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %38
33: ; preds = %30
%34 = load i32, i32* %7
%35 = load i32, i32* %4
%36 = icmp eq i32 %34, %35
br i1 %36, label %37, label %38
37: ; preds = %33
store i32 -1, i32* %7
br label %38
38: ; preds = %37, %33, %30
%39 = load i32, i32* %7
%40 = load i32, i32* %5
%41 = icmp sge i32 %39, %40
br i1 %41, label %42, label %44
42: ; preds = %38
%43 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %46
44: ; preds = %38
%45 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %46
46: ; preds = %44, %42
br label %9
47: ; preds = %9
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 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = add nsw i32 %7, -1
store i32 %8, i32* %1
%9 = icmp eq i32 %7, 0
br i1 %9, label %43, label %10
10: ; preds = %0
%11 = bitcast i32* %2 to i8*
%12 = bitcast i32* %3 to i8*
%13 = bitcast i32* %4 to i8*
br label %14
14: ; preds = %10, %29
%15 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%16 = load i32, i32* %2
%17 = icmp sgt i32 %16, 0
br i1 %17, label %18, label %29
18: ; preds = %14, %18
%19 = phi i32 [ %25, %18 ], [ 0, %14 ]
%20 = phi i32 [ %26, %18 ], [ 0, %14 ]
%21 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%22 = load i32, i32* %4
%23 = and i32 %22, 1
%24 = xor i32 %23, 1
%25 = add nuw nsw i32 %24, %19
%26 = add nuw nsw i32 %20, 1
%27 = load i32, i32* %2
%28 = icmp slt i32 %26, %27
br i1 %28, label %18, label %29
29: ; preds = %18, %14
%30 = phi i32 [ 0, %14 ], [ %25, %18 ]
%31 = phi i32 [ %16, %14 ], [ %27, %18 ]
%32 = load i32, i32* %3
%33 = icmp eq i32 %32, 0
%34 = icmp eq i32 %30, %31
%35 = select i1 %33, i1 %34, i1 false
%36 = select i1 %35, i32 -1, i32 %30
%37 = icmp slt i32 %36, %32
%38 = select i1 %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0)
%39 = call i32 @puts(i8* dereferenceable(1) %38)
%40 = load i32, i32* %1
%41 = add nsw i32 %40, -1
store i32 %41, i32* %1
%42 = icmp eq i32 %40, 0
br i1 %42, label %43, label %14
43: ; preds = %29, %0
ret i32 0
}