#include <bits/stdc++.h>

using namespace std;

#define MAXN 303000

int n, k;
int arr[MAXN];

bool solve() {
    int cnt = 0;
    for (int i = 0; i < n; ++i)
        cnt += arr[i] & 1 ^ 1;
    return cnt >= n / k;
}

int main() {
    int t; cin >> t;
    while (t--) {
        cin >> n >> k;
        for (int i = 0; i < n; ++i)
            cin >> arr[i];
        cout << (solve() ? "YES" : "NO") << endl;
    }
}