t = int(input())
for _ in range(t):
    n, k = map(int, input().split())
    cnt = sum(1 for x in list(map(int, input().split())) if x % 2 == 0)
    if cnt >= n // k:
        print("YES")
    else:
        print("NO")
