#include <bits/stdc++.h>
using namespace std;

static long long a[300000];
static unsigned char used[300000];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int T;
    cin >> T;
    while (T--) {
        int n, k;
        cin >> n >> k;
        for (int i = 0; i < n; ++i) cin >> a[i];
        int need = n / k;
        if (need == 0) {
            cout << "YES\n";
            continue;
        }
        memset(used, 0, n * sizeof(unsigned char));
        bool ok = true;
        int taken = 0;
        while (taken < need && ok) {
            bool found = false;
            for (int j = 0; j < n; ++j) {
                if (!used[j] && ((a[j] & 1LL) == 0)) {
                    used[j] = 1;
                    found = true;
                    break;
                }
            }
            if (!found) {
                ok = false;
                break;
            }
            ++taken;
        }
        if (ok) cout << "YES\n";
        else cout << "NO\n";
    }
    return 0;
}
