#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 n, k, val, j, t, i;
  scanf("%d", &t);
  while (t-- > 0) {
    scanf("%d", &n);
    scanf("%d", &k);
    j = 0;
    for (i = 0; i < n; i++) {
      scanf("%d", &val);
      (val & 1) ? j : j++;
    }
    if (j >= k) {
      if ((k == 0) && (j == n)) {
        printf("NO\n");
      } else {
        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    0xeca(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x18(%rbp)
cmp    $0x0,%eax
jle    1220 <main+0x100>
lea    0xea6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xe96(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11cb <main+0xab>
lea    0xe6c(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     11b4 <main+0x94>
mov    -0x14(%rbp),%eax
jmp    11bd <main+0x9d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1181 <main+0x61>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     120f <main+0xef>
cmpl   $0x0,-0xc(%rbp)
jne    11fe <main+0xde>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    11fe <main+0xde>
lea    0xe0f(%rip),%rdi
call   1030 <printf@plt>
jmp    120a <main+0xea>
lea    0xe02(%rip),%rdi
call   1030 <printf@plt>
jmp    121b <main+0xfb>
lea    0xded(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0x1f>
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    0xecb(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0x8(%rsp)
test   %eax,%eax
jle    11f9 <main+0xd9>
lea    0xea7(%rip),%rbx
lea    0x10(%rsp),%r12
lea    0xea2(%rip),%r13
lea    0xe97(%rip),%rbp
jmp    119e <main+0x7e>
xchg   %ax,%ax
xor    %r14d,%r14d
mov    0x14(%rsp),%ecx
xor    %r14d,%eax
or     %ecx,%eax
mov    %rbp,%rdi
cmove  %r13,%rdi
cmp    %ecx,%r14d
cmovl  %r13,%rdi
call   1030 <puts@plt>
mov    0x8(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0x8(%rsp)
test   %eax,%eax
jle    11f9 <main+0xd9>
mov    %rbx,%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
lea    0x14(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    1170 <main+0x50>
xor    %r15d,%r15d
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
mov    0x10(%rsp),%eax
not    %eax
and    $0x1,%eax
add    %eax,%r14d
add    $0x1,%r15d
mov    0xc(%rsp),%eax
cmp    %eax,%r15d
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"NO\0A\00"
@.str.2 = [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
store i32 0, i32* %1
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
br label %9
9: ; preds = %53, %0
%10 = load i32, i32* %6
%11 = add nsw i32 %10, -1
store i32 %11, i32* %6
%12 = icmp sgt i32 %10, 0
br i1 %12, label %13, label %54
13: ; preds = %9
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
store i32 0, i32* %5
store i32 0, i32* %7
br label %16
16: ; preds = %32, %13
%17 = load i32, i32* %7
%18 = load i32, i32* %2
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %35
20: ; preds = %16
%21 = call 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 = icmp ne i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %20
%26 = load i32, i32* %5
br label %30
27: ; preds = %20
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
store i32 %29, i32* %5
br label %30
30: ; preds = %27, %25
%31 = phi i32 [ %26, %25 ], [ %28, %27 ]
br label %32
32: ; preds = %30
%33 = load i32, i32* %7
%34 = add nsw i32 %33, 1
store i32 %34, i32* %7
br label %16
35: ; preds = %16
%36 = load i32, i32* %5
%37 = load i32, i32* %3
%38 = icmp sge i32 %36, %37
br i1 %38, label %39, label %51
39: ; preds = %35
%40 = load i32, i32* %3
%41 = icmp eq i32 %40, 0
br i1 %41, label %42, label %48
42: ; preds = %39
%43 = load i32, i32* %5
%44 = load i32, i32* %2
%45 = icmp eq i32 %43, %44
br i1 %45, label %46, label %48
46: ; preds = %42
%47 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %50
48: ; preds = %42, %39
%49 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %50
50: ; preds = %48, %46
br label %53
51: ; preds = %35
%52 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %53
53: ; preds = %51, %50
br label %9
54: ; preds = %9
ret i32 0
}

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