#include <bits/stdc++.h>

using namespace std;

#define si(x) scanf("%d", &x)
#define sl(x) scanf("%lld", &x)
#define pf printf

typedef long long int ll;

int t, n, a, b, c, x;

int main(void) {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    si(t);

    while (t--) {
        si(n), si(x);
        a = b = 0;
        vector<int> e, o;
        for (int i = 0; i < n; ++i) {
            si(c);
            if (c % 2 == 1) {
                o.push_back(c);
            } else {
                e.push_back(c);
            }
        }
        c = 0;
        a = x;
        for (int i = 0; i < o.size(); ++i) {
            if (x == 0) break;
            c += 1;
            x--;
        }
        if (c % 2 == 0 && o.size() > 0) {
            c -= 1
            x++;
        }
        for (int i = 0; i < e.size(); ++i) {
            if (x == 0) break;
            c += 2;
            x--;
        }
        if (c % 2 == 1 && x == 0) {
            pf("Yes\n");
        } else {
            pf ("No\n");
        }
    }

    return 0;
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef  unsigned int uint;
typedef  long double ld;

int main()
{

	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif

	ios_base::sync_with_stdio(false);
	cin.tie(0);

	int t;
	cin >> t;

	while (t--)
	{
		int n, x;
		cin  >> n >> x;
		int a[n];
		int ans = 0;
		int numOdds = 0;
		for (int i = 0; i < n; i++)
		{
			cin >> a[i];
			if (a[i] % 2 == 1)
				numOdds++;
		}

		int numEvens = n - numOdds;

		if (x == 0)
		{
			cout << "Yes\n";
			continue;
		}

		if (numOdds == 0)
		{
			cout << "No\n";
			continue;
		}

		if (x <= numEvens + 1)
		{
			cout << "Yes\n";
			continue;
		}

		if (x == n)
		{
			if (numOdds % 2 == 0)
				cout << "No\n";
			else
				cout << "Yes\n";
			continue;
		}
		cout << "Yes\n";
	}

	return 0;
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef  unsigned int uint;
typedef  long double ld;

int main()
{

	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif

	ios_base::sync_with_stdio(false);
	cin.tie(0);

	int t;
	cin >> t;

	while (t--)
	{
		int n, x;
		cin  >> n >> x;
		int a[n];

		for (int i = 0; i < n; i++)
			cin >> a[i];

		int dp[n + 1];
		dp[0] = 0;

		for (int i = 1; i <= n; i++)
		{
			dp[i] = 0;
			for (int j = 0; j < n; j++)
			{
				if (a[j]  == 0)
					continue;
				if (dp[i - 1] == 0 && a[j] % 2 == 1)
				{
					dp[i] = 1;
					a[j] = 0;
					break;
				}
				if (dp[i - 1] == 1 && a[j] % 2 == 0)
				{
					dp[i ] = 1;
					a[j] = 0;
					break;
				}
			}
		}

		if (dp[n] == 1)
			cout << "Yes\n";
		else cout <<"No\n";

	}

	return 0;
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef  unsigned int uint;
typedef  long double ld;

int main()
{

	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif

	ios_base::sync_with_stdio(false);
	cin.tie(0);

	int t;
	cin >> t;

	while (t--)
	{
		int n, x;
		cin >> n >> x;
		int a[n];
		int numEvens = 0;
		for (int i = 0; i < n; i++)
		{
			cin >> a[i];
			if (a[i] % 2 == 0)
				numEvens++;
		}
		int numOdds = n - numEvens;
		int dp[n + 1] ;
		dp[0] = 0;

		for (int i = 1; i <= n; i++)
		{

			for (int j  =0; j < n; j++)
			{
				if (a[j] == 0)
					continue;
				if (dp[i - 1] % 2 == 1)
				{
					if (numEvens <= 0)
					{
						dp[i] = dp[i - 1] + a[j];
						a[j] = 0;
						break;
					}
					if (a[j] % 2 == 0)
					{
						dp[i] = dp[i - 1] + a[j];
						a[j] = 0;
						numEvens--;
						break;
					}
				}
				else if (dp[i - 1] % 2 == 0)
				{
					if (numOdds <= 0)
					{
						dp[i] = dp[i - 1] + a[j];
						a[j] = 0;
						break;
					}
					if (a[j] % 2 == 1)
					{
						dp[i] = dp[i - 1] + a[j];
						a[j] = 0;
						numOdds--;
						break;
					}
				}
			}

		}
		if (dp[x] % 2 == 1)
			cout << "Yes\n";
		else
			cout << "No\n";
	}

	return 0;
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef  unsigned int uint;
typedef  long double ld;

int main()
{

	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif

	ios_base::sync_with_stdio(false);
	cin.tie(0);

	int t;
	cin >> t;

	while (t--)
	{
		int n, x;
		cin  >> n >> x;
		int k;
		int ans = 0;
		int numOdds = 0;
		for (int i = 0; i < n; i++)
		{
			cin >> k;
			if (k % 2 == 1)
				numOdds++;
		}

		int numEvens = n - numOdds;

		if (x == 0)
		{
			cout << "Yes\n";
			continue;
		}

		if (numOdds == 0)
		{
			cout << "No\n";
			continue;
		}
		if (x == n)
		{
			if (numOdds % 2 == 0)
				cout << "No\n";
			else
				cout << "Yes\n";
			continue;
		}
		if (numOdds == n && x % 2 == 0)
		{
		    cout << "NO\n";
		    continue;
		}
		cout << "Yes\n";
	}

	return 0;
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef  unsigned int uint;
typedef  long double ld;

int main()
{

	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif

	ios_base::sync_with_stdio(false);
	cin.tie(0);

	int t;
	cin >> t;

	while (t--)
	{
		int n, x;
		cin  >> n >> x;
		int a[n];

		for (int i = 0; i < n; i++)
			cin >> a[i];

		int dp[n + 1];
		dp[0] = 0;

		for (int i = 1; i <= n; i++)
		{
			dp[i] = 0;
			for (int j = 0; j < n; j++)
			{
				if (a[j]  == 0)
					continue;
				if (dp[i - 1] == 0 && a[j] % 2 == 1)
				{
					dp[i] = 1;
					a[j] = 0;
				}
				if (dp[i - 1] == 1 && a[j] % 2 == 0)
				{
					dp[i ] = 1;
					a[j] = 0;
				}
			}
		}

		if (dp[n] == 1)
			cout << "Yes\n";
		else cout <<"No\n";

	}

	return 0;
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef  unsigned int uint;
typedef  long double ld;

int main()
{

	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif

	ios_base::sync_with_stdio(false);
	cin.tie(0);

	int t;
	cin >> t;

	while (t--)
	{
		int n, x;
		cin  >> n >> x;
		int a[n];
		int ans = 0;
		int numOdds = 0;
		for (int i = 0; i < n; i++)
		{
			cin >> a[i];
			if (a[i] % 2 == 1)
				numOdds++;
		}

		int numEvens = n - numOdds;

		if (x == 0)
		{
			cout << "Yes\n";
			continue;
		}

		if (numOdds == 0)
		{
			cout << "No\n";
			continue;
		}

		if (x <= numEvens)
		{
			cout << "Yes\n";
			continue;
		}

		if (x == n)
		{
			x -= numEvens;
			if (x % 2 == 0)
				cout << "No\n";
			else
				cout << "Yes\n";
			continue;
		}
	}

	return 0;
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef  unsigned int uint;
typedef  long double ld;

int main()
{

	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif

	ios_base::sync_with_stdio(false);
	cin.tie(0);

	int t;
	cin >> t;

	while (t--)
	{
		int n, x;
		cin  >> n >> x;
		int a[n];
		int ans = 0;
		int numOdds = 0;
		for (int i = 0; i < n; i++)
		{
			cin >> a[i];
			if (a[i] % 2)
				numOdds++;
		}

		if (numOdds == 0)
		{
			cout << "No\n";
			continue;
		}
		if (x == n)
		{
			if (numOdds % 2 == 0)
				cout << "No\n";
			else
				cout << "Yes\n";
			continue;
		}
		cout << "Yes\n";

	}

	return 0;
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef  unsigned int uint;
typedef  long double ld;

int main()
{

	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif

	ios_base::sync_with_stdio(false);
	cin.tie(0);

	int t;
	cin >> t;

	while (t--)
	{
		int n, x;
		cin  >> n >> x;
		int a[n];
		int ans = 0;
		int numOdds = 0;
		for (int i = 0; i < n; i++)
		{
			cin >> a[i];
			if (a[i] % 2)
				numOdds++;
		}

		int numEvens = n - numOdds;

		if (x== 0)
		{
			cout << "Yes\n";
			continue;
		}

		if (numOdds == 0)
		{
			cout << "No\n";
			continue;
		}

		if (x <= numEvens)
		{
			cout << "Yes\n";
			continue;
		}

		if (x > numEvens)
		{
			x -= numEvens;
			if (x % 2 == 0)
				cout << "No\n";
			else
				cout << "Yes\n";
			continue;
		}
	}

	return 0;
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef  unsigned int uint;
typedef  long double ld;

int main()
{

	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif

	ios_base::sync_with_stdio(false);
	cin.tie(0);

	int t;
	cin >> t;

	while (t--)
	{
		int n, x;
		cin  >> n >> x;
		int a[n];
		int ans = 0;
		int numOdds = 0;
		for (int i = 0; i < n; i++)
		{
			cin >> a[i];
			if (a[i] % 2 == 1)
				numOdds++;
		}

		int numEvens = n - numOdds;

		if (x == 0)
		{
			cout << "Yes\n";
			continue;
		}

		if (numOdds == 0)
		{
			cout << "No\n";
			continue;
		}

		if (x <= numEvens + 1)
		{
			cout << "Yes\n";
			continue;
		}
		if (x == n && numOdds == n)
		{
			if (numOdds % 2)
				cout << "Yes\n";
			else
				cout << "No\n";
			continue;
		}

		if (x == n)
		{
			if (numOdds % 2 == 0)
				cout << "No\n";
			else
				cout << "Yes\n";
			continue;
		}
		cout << "Yes\n";
	}

	return 0;
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef  unsigned int uint;
typedef  long double ld;

int main()
{

	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif

	ios_base::sync_with_stdio(false);
	cin.tie(0);

	int t;
	cin >> t;

	while (t--)
	{
		int n, x;
		cin  >> n >> x;
		int k;
		int ans = 0;
		int numOdds = 0;
		for (int i = 0; i < n; i++)
		{
			cin >> k;
			if (k % 2 == 1)
				numOdds++;
		}

		int numEvens = n - numOdds;

		if (x == 0)
		{
			cout << "Yes\n";
			continue;
		}

		if (numOdds == 0)
		{
			cout << "No\n";
			continue;
		}
		if (x == n)
		{
			if (numOdds % 2 == 0)
				cout << "No\n";
			else
				cout << "Yes\n";
			continue;
		}
		if (numOdds == n && x % 2 == 0)
		{
		    cout << "Yes\n";
		    continue;
		}
		cout << "Yes\n";
	}

	return 0;
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef  unsigned int uint;
typedef  long double ld;

int main()
{

	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif

	ios_base::sync_with_stdio(false);
	cin.tie(0);

	int t;
	cin >> t;

	while (t--)
	{
		int n, x;
		cin  >> n >> x;
		int k;
		int ans = 0;
		int numOdds = 0;
		for (int i = 0; i < n; i++)
		{
			cin >> k;
			if (k % 2 == 1)
				numOdds++;
		}

		int numEvens = n - numOdds;

		if (x == 0)
		{
			cout << "Yes\n";
			continue;
		}

		if (numOdds == 0)
		{
			cout << "No\n";
			continue;
		}
		if (x == n)
		{
			if (numOdds % 2 == 0)
				cout << "No\n";
			else
				cout << "Yes\n";
			continue;
		}
		cout << "Yes\n";
	}

	return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pb push_back
#define popb pop_back
using namespace std;
ll mod=1000000007;

int main(){
    ll t;cin>>t;
    while(t--){
    	int n,x;
    	cin>>n>>x;
    	int on=0,en=0;
    	int arr[n];
    	for(int i=0;i<n;i++){
    		cin>>arr[i];
    		if(arr[i]%2==0)	en++;
    		else on++;
    	}
    	if(on==0){
    		cout<<"No"<<endl;
    		continue;
    	}
    	if(on%2!=0){
    		if(x%2!=0 || x>=on){
    			cout<<"Yes"<<endl;
    			continue;
    		}else{
    			x=x-en;
    			if(x<=0 || x%2!=0){
    				cout<<"Yes"<<endl;
    			}
    			else{
    				cout<<"No"<<endl;
    			}
    		}
    	}
    	else{
    		x=x-en;
    		if(x%2!=0 || x<=0){
    			cout<<"Yes"<<endl;
    		}
    		else{
    			cout<<"No"<<endl;
    		}
    	}

    }
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pb push_back
#define popb pop_back
using namespace std;
ll mod=1000000007;

int main(){
    ll t;cin>>t;
    while(t--){
    	int n,x;
    	cin>>n>>x;
    	int on=0,en=0;
    	int arr[n];
    	for(int i=0;i<n;i++){
    		cin>>arr[i];
    		if(arr[i]%2==0)	en++;
    		else on++;
    	}
    	if(on==0){
    		cout<<"No"<<endl;
    		continue;
    	}
    	x=x-en;
    	if(x<=0){
    		cout<<"Yes"<<endl;
    	}
    	else{
    		if(x%2!=0){
    		cout<<"Yes"<<endl;
    		}
    		else if(x+1<=on){
    			cout<<"Yes"<<endl;
    		}
    		else{
    			cout<<"No"<<endl;
    		}
    	}
    }
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pb push_back
#define popb pop_back
using namespace std;
ll mod=1000000007;

int main(){
    ll t;cin>>t;
    while(t--){
    	int n,x;
    	cin>>n>>x;
    	int on=0,en=0;
    	int arr[n];
    	for(int i=0;i<n;i++){
    		cin>>arr[i];
    		if(arr[i]%2==0)	en++;
    		else on++;
    	}
    	if(on==0){
    		cout<<"No"<<endl;
    		continue;
    	}
    	if(on%2!=0 ){
    		if(x>=on){
    			cout<<"Yes"<<endl;
    		    continue;
    		}
    		if(x%2!=0){
    			cout<<"Yes"<<endl;
    		}
    		else{
    			if(en>1){
    				cout<<"Yes"<<endl;
    			}else{
    				cout<<"No"<<endl;
    			}
    		}
    	}
    	else{
    		if(x<on){
    			cout<<"Yes"<<endl;
    		}
    		else{
    			on--;
    			x=x-on;
    			if(en>=x){
    				cout<<"Yes"<<endl;
    			}else{
    				cout<<"No"<<endl;
    			}
    		}
    	}

    }
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pb push_back
#define popb pop_back
using namespace std;
ll mod=1000000007;

int main(){
    ll t;cin>>t;
    while(t--){
    	int n,x;
    	cin>>n>>x;
    	int on=0,en=0;
    	int arr[n];
    	for(int i=0;i<n;i++){
    		cin>>arr[i];
    		if(arr[i]%2==0)	en++;
    		else on++;
    	}
    	if(on==0){
    		cout<<"No"<<endl;
    		continue;
    	}
    	if(on>=x){
    		if(x%2!=0){
    			cout<<"Yes"<<endl;
    		}
    		else if(en>0){
    			cout<<"Yes"<<endl;
    		}
    		else{
    			cout<<"No"<<endl;
    		}
    	}else{
    		if(on%2!=0){
    			cout<<"Yes"<<endl;
    		}
    		else{
    			on--;
    			x=x-on;
    			if(en>=x){
    				cout<<"Yes"<<endl;
    			}
    			else
    		    	cout<<"No"<<endl;
    		}
    	}

    }
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pb push_back
#define popb pop_back
using namespace std;
ll mod=1000000007;

int main(){
    ll t;cin>>t;
    while(t--){
    	int n,x;
    	cin>>n>>x;
    	int on=0,en=0;
    	int arr[n];
    	for(int i=0;i<n;i++){
    		cin>>arr[i];
    		if(arr[i]%2==0)	en++;
    		else on++;
    	}
    	if(on==0){
    		cout<<"No"<<endl;
    		continue;
    	}
    	if(on%2!=0 && x>=on){
    		cout<<"Yes"<<endl;
    	}
    	else{
    		x=x-en;
    		if(x<=0){
    			cout<<"Yes"<<endl;
    		}
    		else{
    			if(x%2!=0){
    				cout<<"Yes"<<endl;
    			}
    			else if(x+1<=on){
    				cout<<"Yes"<<endl;
    			}
    			else{
    				cout<<"No"<<endl;
    			}
    		}
    	}
    }
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pb push_back
#define popb pop_back
using namespace std;
ll mod=1000000007;

int main(){
    ll t;cin>>t;
    while(t--){
    	int n,x;
    	cin>>n>>x;
    	int on=0,en=0;
    	int arr[n];
    	for(int i=0;i<n;i++){
    		cin>>arr[i];
    		if(arr[i]%2==0)	en++;
    		else on++;
    	}
    	if(on==0){
    		cout<<"No"<<endl;
    		continue;
    	}
    	if(on%2!=0){
    		cout<<"Yes"<<endl;
    	}
    	else{
    		x=x-en;
    		if(x<=0){
    			cout<<"Yes"<<endl;
    		}
    		else{
    			if(x%2!=0){
    				cout<<"Yes"<<endl;
    			}
    			else if(x+1<=on){
    				cout<<"Yes"<<endl;
    			}
    			else{
    				cout<<"No"<<endl;
    			}
    		}
    	}
    }
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pb push_back
#define popb pop_back
using namespace std;
ll mod=1000000007;

int main(){
    ll t;cin>>t;
    while(t--){
    	int n,x;
    	cin>>n>>x;
    	int on=0,en=0;
    	int arr[n];
    	for(int i=0;i<n;i++){
    		cin>>arr[i];
    		if(arr[i]%2==0)	en++;
    		else on++;
    	}
    	if(on==0){
    		cout<<"No"<<endl;
    		continue;
    	}
    	if(x%2!=0 && on>=x){
    		cout<<"Yes"<<endl;
    		continue;
    	}
    	x=x-en;
    	if(x<=0){
    		cout<<"Yes"<<endl;
    	}
    	else{
    		if(x%2!=0){
    		cout<<"Yes"<<endl;
    		}
    		else if(x+1<=on){
    			cout<<"Yes"<<endl;
    		}
    		else{
    			cout<<"No"<<endl;
    		}
    	}
    }
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pb push_back
#define popb pop_back
using namespace std;
ll mod=1000000007;

int main(){
    ll t;cin>>t;
    while(t--){
    	int n,x;
    	cin>>n>>x;
    	int on=0,en=0;
    	int arr[n];
    	for(int i=0;i<n;i++){
    		cin>>arr[i];
    		if(arr[i]%2==0)	en++;
    		else on++;
    	}
    	if(x==on && en>0){
    		cout<<"Yes"<<endl;
    		continue;
    	}
    	if(on==0){
    		cout<<"No"<<endl;
    		continue;
    	}
    	if(on%2==0){
    		on--;
    		x=x-on;
    		if(x<=0 || (x-en<1 && en>0))	cout<<"Yes"<<endl;
    		else	cout<<"No"<<endl;
    		continue;
    	}
    	cout<<"Yes"<<endl;

    }
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pb push_back
#define popb pop_back
using namespace std;
ll mod=1000000007;

int main(){
    ll t;cin>>t;
    while(t--){
    	int n,x;
    	cin>>n>>x;
    	int on=0,en=0;
    	int arr[n];
    	for(int i=0;i<n;i++){
    		cin>>arr[i];
    		if(arr[i]%2==0)	en++;
    		else on++;
    	}
    	if(on==0){
    		cout<<"No"<<endl;
    		continue;
    	}
    	if(on%2==0){
    		on--;
    		x=x-on;
    		x=x-en;
    		if(x<=0)	cout<<"Yes"<<endl;
    		else	cout<<"No"<<endl;
    		continue;
    	}
    	cout<<"Yes"<<endl;

    }
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pb push_back
#define popb pop_back
using namespace std;
ll mod=1000000007;

int main(){
    ll t;cin>>t;
    while(t--){
    	int n,x;
    	cin>>n>>x;
    	int on=0,en=0;
    	int arr[n];
    	for(int i=0;i<n;i++){
    		cin>>arr[i];
    		if(arr[i]%2==0)	en++;
    		else on++;
    	}
    	if(on==0){
    		cout<<"No"<<endl;
    		continue;
    	}
    	if(on%2!=0){
    		if(x%2!=0 || x>=on){
    			cout<<"Yes"<<endl;
    			continue;
    		}else{
    			x=x-en;
    			if(x<=0 || x%2!=0){
    				cout<<"Yes"<<endl;
    			}
    			else{
    				cout<<"No"<<endl;
    			}
    		}
    	}
    	else{
    		x=x-en;
    		if(x<=0 || x%2!=0){
    			cout<<"Yes"<<endl;
    		}
    		else{
    			cout<<"No"<<endl;
    		}
    	}

    }
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pb push_back
#define popb pop_back
using namespace std;
ll mod=1000000007;

int main(){
    ll t;cin>>t;
    while(t--){
    	int n,x;
    	cin>>n>>x;
    	int on=0,en=0;
    	int arr[n];
    	for(int i=0;i<n;i++){
    		cin>>arr[i];
    		if(arr[i]%2==0)	en++;
    		else on++;
    	}
    	if(on==0){
    		cout<<"No"<<endl;
    		continue;
    	}
    	if(on%2!=0){
    		if(x%2!=0 || x>=on){
    			cout<<"Yes"<<endl;
    			continue;
    		}else{
    			x=x-en;
    			if(x<=0 || x%2!=0){
    				cout<<"Yes"<<endl;
    			}
    			else{
    				cout<<"No"<<endl;
    			}
    		}
    	}
    	else{
    		if(x%2!=0){
    			cout<<"Yes"<<endl;
    		}else{
    			x=x-en;
    			if(x<=0 || x%2!=0){
    				cout<<"Yes"<<endl;
    			}else{
    				cout<<"No"<<endl;
    			}
    		}
    	}

    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define du double
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)

void solve(){
  int x,n,o=0,e=0;
  cin>>n>>x;
  int arr[n];
  rep(i,n){
      cin>>arr[i];
      if(arr[i]%2) o++;
      else e++;
  }
  if(o<=0) cout<<"No\n";
  else if(o>=x && x%2==1 && o>0) cout<<"Yes\n";
  else if(o>=x && x%2==0 && e>0) cout<<"Yes\n";
  else if(o<x && o>0 && o%2==1 ) cout<<"Yes\n";
  else if((x-(o-1))<=e && o%2==0) cout<<"Yes\n";
  else cout<<"No\n";

}

int main()
{
int k;
cin>>k;
 while(k--)
solve();

return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define loop() int t; cin>>t; while(t--)

void solve(){
    int n,x,o=0,e=0;
    cin>>n>>x;
    int arr[n];
    rep(i,n) {
        cin>>arr[i];
        if(arr[i]%2) o++;
        else e++;
    }

    if(x==n){
        if( o%2) cout<<"Yes\n";
        else cout<<"No\n";
    }
    else if(x<n){
        if(x%2 && o>0 ) cout<<"Yes\n";
        else if(x%2==0 && o>0 && e>0 ) cout<<"Yes\n";
        else cout<<"No\n";
    }
}

int main(){
loop() {
    solve();
}
return 0;
}


    #include <bits/stdc++.h>
    #define ll long long
    using namespace std;
    int main() {
    	int t;cin>>t;
    	while(t--){
    		int e=0,o=0,n,x;cin>>n>>x;
    		vector<int>v(n);
    		for(int i=0;i<n;++i){
    			cin>>v[i];
    			if(v[i]&1)o++;
    			else e++;
    		}
    		if(o&1)cout<<"Yes"<<endl;
    		else{
    			if(((o-1)+e)&1)cout<<"Yes"<<endl;
    			else cout<<"No"<<endl;
    		}
    	}
    	return 0;
    }


#include<bits/stdc++.h>
using namespace std;
#define du double
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)

void solve(){
  int x,n,o=0,e=0;
  cin>>n>>x;
  int arr[n];
  rep(i,n){
      cin>>arr[i];
      if(arr[i]%2) o++;
      else e++;
  }
//   if(o<=0) cout<<"No\n";
//   else if(o>=x && x%2==1 && o>0) cout<<"Yes\n";
//   else if(o>=x && x%2==0 && e>0) cout<<"Yes\n";
//   else if(o<x && o>0 && o%2==1 ) cout<<"Yes\n";
//   else if((x-(o-1))<=e && o%2==0) cout<<"Yes\n";
//   else cout<<"No\n";

  if(o<=0) cout<<"No\n";
  else {
      if(o%2==0){
          if(x<o && e>0) cout<<"Yes\n";
          else if(x>=o && x%2==0  )
          cout<<"Yes\n";
          else cout<<"No\n";
      }
      else {
          if(x>=o) cout<<"Yes\n";
          else cout<<"No\n";
      }
  }

}

int main()
{
int k;
cin>>k;
 while(k--)
solve();

return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define du double
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)

void solve(){
  int x,n,o=0,e=0;
  cin>>n>>x;
  int arr[n];
  rep(i,n){
      cin>>arr[i];
      if(arr[i]%2) o++;
      else e++;
  }
  if(o<=0) cout<<"No\n";
  else if(o>=x && x%2==1 && o>0) cout<<"Yes\n";
  else if(o>=x && x%2==0 && e>0) cout<<"Yes\n";
  else if(o<x && o>0 && o%2==1 ) cout<<"Yes\n";
  else if((x-(o-1))<=e) cout<<"Yes\n";
  else cout<<"No\n";

}

int main()
{
int k;
cin>>k;
 while(k--)
solve();

return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define loop() int t; cin>>t; while(t--)

void solve(){
    int n,x,o=0,e=0;
    cin>>n>>x;
    int arr[n];
    rep(i,n) {
        cin>>arr[i];
        if(arr[i]%2) o++;
        else e++;
    }

    if(x==n){
        if( o%2) cout<<"Yes\n";
        else cout<<"No\n";
    }
    else if(x<n){
        if(x%2 && o>0 ) cout<<"Yes\n";
        else if(!x%2 && o>0 && e>0 ) cout<<"Yes\n";
        else cout<<"No\n";
    }
}

int main(){
loop() {
    solve();
}
return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define du double
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)

void solve(){
  int x,n,o=0,e=0;
  cin>>n>>x;
  int arr[n];
  rep(i,n){
      cin>>arr[i];
      if(arr[i]%2) o++;
      else e++;
  }
//   if(o<=0) cout<<"No\n";
//   else if(o>=x && x%2==1 && o>0) cout<<"Yes\n";
//   else if(o>=x && x%2==0 && e>0) cout<<"Yes\n";
//   else if(o<x && o>0 && o%2==1 ) cout<<"Yes\n";
//   else if((x-(o-1))<=e && o%2==0) cout<<"Yes\n";
//   else cout<<"No\n";

  if(o<=0) cout<<"No\n";
  else {
      if(o%2==0){
          if(x<o && e>0) cout<<"Yes\n";
          else if(x>=o && x%2==0  )
          cout<<"Yes\n";
          else cout<<"No\n";
      }
      else {
          if(x>=o) cout<<"Yes\n";
          else if(x<o && x%2==1) cout<<"Yes\n";
          else if(x<0 && x%2==0 && e>0) cout<<"Yes\n";
          else cout<<"No\n";
      }
  }

}

int main()
{
int k;
cin>>k;
 while(k--)
solve();

return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define du double
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)

void solve(){
  int x,n,o=0,e=0;
  cin>>n>>x;
  int arr[n];
  rep(i,n){
      cin>>arr[i];
      if(arr[i]%2) o++;
      else e++;
  }
  if(o>=x && x%2==1 && o>0) cout<<"Yes\n";
  else if(o<x && o>0 && o%2==1 ) cout<<"Yes\n";
  else if((x-(o-1))<=e) cout<<"Yes\n";
  else cout<<"No\n";

}

int main()
{
int k;
cin>>k;
 while(k--)
solve();

return 0;
}


    #include <iostream>
    using namespace std;

    int main() {
    	int t; cin >> t;
    	while(t--)
    	{
    		int odd = 0, even = 0;
    		int n, x; cin >> n >> x;
    		for(int i = 0; i < n; i++)
    		{
    			int x; cin >> x;
    			if(x % 2)odd++;
    			else even++;
    		}
    		if(odd == 0)cout << "No" << endl;
    		else
    		{
    			if(odd % 2 == 0)odd--;
    			if(even >= x - odd)cout << "Yes" << endl;
    			else cout << "No" << endl;
    		}
    	}
    	return 0;
    }


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define loop() int t; cin>>t; while(t--)

void solve(){
    int n,x,o=0,e=0;
    cin>>n>>x;
    int arr[n];
    rep(i,n) {
        cin>>arr[i];
        if(arr[i]%2) o++;
        else e++;
    }

    if(x==n){
        if( o%2) cout<<"Yes\n";
        else cout<<"No\n";
    }
    else if(x<n){
        if(o>0) cout<<"Yes\n";
        else cout<<"No\n";
    }
}

int main(){
loop() {
    solve();
}
return 0;
}


/*
  In the name of ALLAH
  Author : Raashid Anwar
*/

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

#define int int64_t
const int M1 =  998244353;
const int M2 =  1000000007;

void solve() {
  int n,x,a;
  cin>>n>>x;
  int b[2]={};
  for(int i=0;i<n;i++) {
    cin>>a;
    b[a&1]++;
  }
  if(b[1]==0) {
    cout<<"No\n";
    return ;
  }
  if(b[1]%2==0)
    b[1]--;
  if(x<=b[1]+b[0])
    cout<<"Yes\n";
  else
    cout<<"No\n";
}

int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin>>t;
  while(t--)
    solve();
}


/*
  In the name of ALLAH
  Author : Raashid Anwar
*/

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

#define int int64_t
const int M1 =  998244353;
const int M2 =  1000000007;

void solve() {
  int n,x,a;
  cin>>n>>x;
  int b[2]={};
  for(int i=0;i<n;i++) {
    cin>>a;
    b[a&1]++;
  }
  if(b[1]==0) {
    cout<<"No\n";
    return ;
  }
  if(x-1<=b[0]+(2*((b[1]-1)/2)/2))
    cout<<"Yes\n";
  else
    cout<<"No\n";
}

int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin>>t;
  while(t--)
    solve();
}


/*
  In the name of ALLAH
  Author : Raashid Anwar
*/

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

#define int int64_t
const int M1 =  998244353;
const int M2 =  1000000007;

void solve() {
  int n,x;
  cin>>n>>x;
  vector <int> a(n);
  int b[2]={};
  for(int &x : a) {
    cin>>x;
    b[x&1]++;
  }
  if(b[1]==0) {
    cout<<"No\n";
    return ;
  }
  x=x-1-(2*((b[1]-1)/2));
  if(b[0]>=x)
    cout<<"Yes\n";
  else
    cout<<"No\n";
}

int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin>>t;
  while(t--)
    solve();
}


/*
  In the name of ALLAH
  Author : Raashid Anwar
*/

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

#define int int64_t
const int M1 =  998244353;
const int M2 =  1000000007;

void solve() {
  int n,x,a;
  cin>>n>>x;
  int b[2]={};
  memset(b,0,sizeof(b));
  for(int i=0;i<n;i++) {
    cin>>a;
    b[a&1]++;
  }
  if(b[1]==0||(x==n&&(b[1]%2)==0)||(x%2==0&&b[0]==0))
    cout<<"No\n";
  else
    cout<<"Yes\n";
}

int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin>>t;
  while(t--)
    solve();
}


/*
  In the name of ALLAH
  Author : Raashid Anwar
*/

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

#define int int64_t
const int M1 =  998244353;
const int M2 =  1000000007;

void solve() {
  int n,x,a;
  cin>>n>>x;
  int b[2]={};
  for(int i=0;i<n;i++) {
    cin>>a;
    b[a&1]=1;
  }
  if(!b[1]) {
    cout<<"No\n";
    return ;
  }
  a=min(x,b[1]);
  if(!(a&1))
    a--;
  if(x<=a+b[0])
    cout<<"Yes\n";
  else
    cout<<"No\n";
}

int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin>>t;
  while(t--)
    solve();
}


/*
  In the name of ALLAH
  Author : Raashid Anwar
*/

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

#define int int64_t
const int M1 =  998244353;
const int M2 =  1000000007;

void solve() {
  int n,x;
  cin>>n>>x;
  vector <int> a(n);
  int b[2]={};
  for(int &x : a) {
    cin>>x;
    b[x&1]++;
  }
  if(!b[1]) {
    cout<<"No\n";
    return ;
  }
  x=x-1-((b[1]-1)/2);
  if(b[0]>=x)
    cout<<"Yes\n";
  else
    cout<<"No\n";
}

int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin>>t;
  while(t--)
    solve();
}


/*
  In the name of ALLAH
  Author : Raashid Anwar
*/

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

#define int int64_t
const int M1 =  998244353;
const int M2 =  1000000007;

void solve() {
  int n,x,a;
  cin>>n>>x;
  int b[2]={};
  for(int i=0;i<n;i++) {
    cin>>a;
    b[a&1]=1;
  }
  if(!b[1]) {
    cout<<"No\n";
    return ;
  }
  if(b[1]%2==0)
    b[1]--;
  if(x<=b[1]+b[0])
    cout<<"Yes\n";
  else
    cout<<"No\n";
}

int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin>>t;
  while(t--)
    solve();
}


/*
  In the name of ALLAH
  Author : Raashid Anwar
*/

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

#define int int64_t
const int M1 =  998244353;
const int M2 =  1000000007;

void solve() {
  int n,x,a;
  cin>>n>>x;
  int b[2]={};
  for(int i=0;i<n;i++) {
    cin>>a;
    b[a&1]++;
  }
  if(b[1]==0||(x%2==0&&b[0]==0)) {
    cout<<"No\n";
    return ;
  }
  if(x-1<=b[0]+(2*((b[1]-1)/2)/2))
    cout<<"Yes\n";
  else
    cout<<"No\n";
}

int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin>>t;
  while(t--)
    solve();
}


/*
  In the name of ALLAH
  Author : Raashid Anwar
*/

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

#define int int64_t
const int M1 =  998244353;
const int M2 =  1000000007;

void solve() {
  int n,x,a;
  cin>>n>>x;
  int b[2]={};
  memset(b,0,sizeof(b));
  for(int i=0;i<n;i++) {
    cin>>a;
    b[a&1]++;
  }
  if(b[1]==0||(x==n&&(b[1]%2)==0))
    cout<<"No\n";
  else
    cout<<"Yes\n";
}

int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin>>t;
  while(t--)
    solve();
}


/*
  In the name of ALLAH
  Author : Raashid Anwar
*/

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

#define int int64_t
const int M1 =  998244353;
const int M2 =  1000000007;

void solve() {
  int n,x,a;
  cin>>n>>x;
  int b[2]={};
  memset(b,0,sizeof(b));
  for(int i=0;i<n;i++) {
    cin>>a;
    b[a&1]++;
  }
  if(b[1]==0) {
    cout<<"No\n";
    return ;
  }
  if(b[1]%2==0)
    b[1]--;
  if(x<=b[1]+b[0])
    cout<<"Yes\n";
  else
    cout<<"No\n";
}

int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin>>t;
  while(t--)
    solve();
}


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

int main()
{
    ll t;
    cin >> t;
    while(t--)
    {
        ll n, x;
        cin >> n >> x;
        ll even = 0, odd = 0;
        for(ll i=0; i<n; i++)
        {
            ll p;
            cin >> p;
            if(p%2)
                odd++;
            else even++;
        }
        if(odd==0)
        {
            cout << "No" << endl;
            continue;
        }
        else
        {
            if(odd%2)
            {
                cout << "Yes" << endl;
                continue;
            }
            odd--;
            if(even + odd >= x)
            {
                cout << "Yes" << endl;
            }
            else
            {
                cout << "No" << endl;
            }
        }
    }
    return 0;
}


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

int main()
{
    ll t;
    cin >> t;
    while(t--)
    {
        ll n, x;
        cin >> n >> x;
        ll even = 0, odd = 0;
        for(ll i=0; i<n; i++)
        {
            ll p;
            cin >> p;
            if(p%2)
                odd++;
            else even++;
        }
        if(odd==0)
        {
            cout << "No" << endl;
            continue;
        }
        x--;
        odd--;
        odd = odd - odd%2;
        if(even + odd >=x)
            cout << "Yes" << endl;
        else
            cout << "No" << endl;
    }

    return 0;
}


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

int main()
{
    ll t;
    cin >> t;
    while(t--)
    {
        ll n, x;
        cin >> n >> x;
        ll a[n];
        ll even = 0, odd = 0;
        for(ll i=0; i<n; i++)
        {
            ll p;
            cin >> p;
            a[i] = p;
            if(p%2)
                odd++;
            else even++;
        }
        if(x%2)
        {
            if(even>x-1)
            {
                if(odd)
                {
                    cout << "Yes" << endl;
                }
                else
                {
                    cout << "No" << endl;
                }
            }
            else
            {
                if(odd%2==0)
                    odd--;
                    if(odd>=x)
                    {
                        cout << "Yes" << endl;
                    }
                    else
                    {
                        x -= odd;
                        if(even >= x)
                        {
                            cout << "Yes" << endl;
                        }
                        else
                        {
                            cout << "No" << endl;
                        }
                    }

            }
        }
        else
        {
            if(odd==0)
            {
                cout << "No" << endl;
                continue;
            }
            if(odd%2==0)
                odd--;
            x-=odd;
            if(even>=x)
            {
                cout << "Yes" << endl;
            }
            else
            {
                cout << "No" << endl;
            }
        }

    }
    return 0;
}


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

int main()
{
    ll t;
    cin >> t;
    while(t--)
    {
        ll n, x;
        cin >> n >> x;
        if(x>n)
        {
            cout << "No" << endl;
            continue;
        }
        ll even = 0, odd = 0;
        for(ll i=0; i<n; i++)
        {
            ll p;
            cin >> p;
            if(p%2)
                odd++;
            else even++;
        }
        if(odd==0)
        {
            cout << "No" << endl;
            continue;
        }
        else
        {
            if(odd%2)
            {
                cout << "Yes" << endl;
                continue;
            }
            odd--;
            if(even + odd > x)
            {
                cout << "Yes" << endl;
            }
            else
            {
                cout << "No" << endl;
            }
        }
    }
    return 0;
}


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

int main()
{
    ll t;
    cin >> t;
    while(t--)
    {
       ll n, x;
       cin >> n >> x;
       ll odd = 0;
       for(ll i=0; i<n; i++)
       {
           ll x;
           cin >> x;
           if(x%2)
            odd++;
       }
       ll even = n - odd;
       if(odd==0)
       {
           cout << "No" << endl;
       }
       else if(odd==2)
       {
           if(even + odd - 1 >= x)
           {
               cout << "Yes" << endl;
           }
           else
           {
               cout << "No" << endl;
           }
       }
       else
       {
           cout << "Yes" << endl;
       }
    }

    return 0;
}


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

int main()
{
    ll t;
    cin >> t;
    while(t--)
    {
       ll n, x;
       cin >> n >> x;
       ll y = 0;
       for(ll i=0; i<n; i++)
       {
           ll p;
           cin >> p;
           if(p%2)
            y++;
       }
       ll even = n-y;
       ll odd = y;
       if(odd==0)
       {
           cout << "No" << endl;
           continue;
       }
       if(even==0 && odd%2==0)
       {
           cout << "No" << endl;
           continue;
       }
       if(even + 1>=x)
       {
           cout << "Yes" << endl;
       }
       else
       {
           if(odd>3)
           {
               cout << "Yes" << endl;
           }
           else
           {
               cout << "No" << endl;
           }
       }
    }

    return 0;
}


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

int main()
{
    ll t;
    cin >> t;
    while(t--)
    {
        ll n, x;
        cin >> n >> x;
        ll e = 0, o = 0;
        for(ll i=0; i<n; i++)
        {
            ll p;
            cin >> p;
            if(p%2)
                o++;
        }
        e = n-o;
        if(!o || (x%2==0 && e==0))
        {
            cout << "No" << endl;
            continue;
        }
        if(e + o - (o%2==0) >= x)
        {
            cout << "Yes" << endl;
        }
        else
        {
            cout << "No" << endl;
        }
    }

    return 0;
}


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

int main()
{
    ll t;
    cin >> t;
    while(t--)
    {
        ll n, x;
        cin >> n >> x;
        if(x>n)
        {
            cout << "No" << endl;
            continue;
        }
        ll even = 0, odd = 0;
        for(ll i=0; i<n; i++)
        {
            ll p;
            cin >> p;
            if(p%2)
                odd++;
            else even++;
        }
        if(odd==0)
        {
            cout << "No" << endl;
            continue;
        }
        else
        {
            if(odd%2)
            {
                cout << "Yes" << endl;
                continue;
            }
            odd--;
            if(even + odd >= x)
            {
                cout << "Yes" << endl;
            }
            else
            {
                cout << "No" << endl;
            }
        }
    }
    return 0;
}


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

int main()
{
    ll t;
    cin >> t;
    while(t--)
    {
       ll n, x;
       cin >> n >> x;
       ll y = 0;
       for(ll i=0; i<n; i++)
       {
           ll p;
           cin >> p;
           if(p%2)
            y++;
       }
       ll even = n-y;
       ll odd = y;
       if(odd==0)
       {
           cout << "No" << endl;
           continue;
       }
       if(even + 1>=x)
       {
           cout << "Yes" << endl;
       }
       else
       {
           if(odd>2)
           {
               cout << "Yes" << endl;
           }
           else
           {
               cout << "No" << endl;
           }
       }
    }

    return 0;
}


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

int main()
{
    ll t;
    cin >> t;
    while(t--)
    {
       ll n, x;
       cin >> n >> x;
       ll y = 0;
       for(ll i=0; i<n; i++)
       {
           ll p;
           cin >> p;
           if(p%2)
            y++;
       }
       ll even = n-y;
       ll odd = y;
       if(odd==0)
       {
           cout << "No" << endl;
           continue;
       }
       if(even + 1>=x)
       {
           cout << "Yes" << endl;
       }
       else
       {
           if(odd>3)
           {
               cout << "Yes" << endl;
           }
           else
           {
               cout << "No" << endl;
           }
       }
    }

    return 0;
}


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

int main()
{
    ll t;
    cin >> t;
    while(t--)
    {
       ll n, x;
       cin >> n >> x;
       ll y = 0;
       for(ll i=0; i<n; i++)
       {
           ll p;
           cin >> p;
           if(p%2)
            y++;
       }
       ll even = n-y;
       ll odd = y;
       if(odd==0)
       {
           cout << "No" << endl;
           continue;
       }
       if(x%2==0 && even==0)
       {
           cout << "No" << endl;
           continue;
       }
       if(even + 1>=x)
       {
           cout << "Yes" << endl;
       }
       else
       {
           if(odd>3)
           {
               cout << "Yes" << endl;
           }
           else
           {
               cout << "No" << endl;
           }
       }
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--){
        int a,b;
        cin>>a>>b;
        int sum = 0;
        int arr[a];
        for(int i=0; i<a; i++)cin>>arr[i];
        int even=0,odd=0;
        for(int i=0; i<a; i++)
        {
            if(arr[i]&1) odd++;
            else even++;
        }
        if(odd==0){
            cout<<"NO"<<endl;
            return 0;
        }
        for(int i=1; i<=odd; i+=2)
        {
            if(i>b)break;
            if((a-i)<=even)
            {
                cout<<"Yes"<<endl;
                return 0;
            }
        }
        cout<<"No"<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--){
        int a,b;
        cin>>a>>b;
        int sum = 0;
        int arr[a];
        for(int i=0; i<a; i++)cin>>arr[i];
        int even=0,odd=0;
        for(int i=0; i<a; i++)
        {
            if(arr[i]&1) odd++;
            else even++;
        }
        if(odd==0){
            cout<<"NO"<<endl;
            return 0;
        }
        for(int i=1; i<=odd; i+=2)
        {
            if(i>x)break;
            if((x-i)<=even)
            {
                cout<<"Yes"<<endl;
                return;
            }
        }
        cout<<"No"<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int solve();
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        solve();
    }
}
int solve()
{
    int a,b;
    cin>>a>>b;
    int sum = 0;
    int arr[a];
    for(int i=0; i<a; i++)
        cin>>arr[i];
    int even=0,odd=0;
    for(int i=0; i<a; i++)
    {
        if(arr[i]%2)
            odd++;
        else
            even++;
    }
    if(b%2==0){
        if(odd%2==0)
        {
            if(odd>0 && even>0 && odd-1+even>=b)
            {
                cout<<"YES"<<endl;
            }
            else cout<<"NO"<<endl;
        }
        else
        {
            if(even>0 && odd+even>=b && odd>0)
            {
                cout<<"YES"<<endl;
            }
            else cout<<"NO"<<endl;
        }
    }
    else
    {
        if(odd%2==0)
        {
            if(odd-1+even>=b && odd>0) cout<<"YES"<<endl;
            else cout<<"NO"<<endl;
        }
        else cout<<"YES"<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--){
        int a,b;
        cin>>a>>b;
        int sum = 0;
        int arr[a];
        for(int i=0; i<a; i++)cin>>arr[i];

        for(int i=0; i<b; i++)
        {
            sum+=arr[i];
        }
        if(sum%2!=0) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int solve();
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        solve();
    }
}
int solve()
{
    int a,b;
    cin>>a>>b;
    int sum = 0;
    int arr[a];
    for(int i=0; i<a; i++)
        cin>>arr[i];
    int even=0,odd=0;
    for(int i=0; i<a; i++)
    {
        if(arr[i]%2==1)
            odd++;
        else
            even++;
    }
    if(odd==0)
    {
        cout<<"NO"<<endl;
        return 0;
    }
    for(int i=1; i<=odd; i+=2)
    {
        if(i>b)
            break;
        if((a-i)<=even)
        {
            cout<<"YES"<<endl;
            return 0;
        }
    }
    cout<<"NO"<<endl;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--){
        int a,b;
        cin>>a>>b;
        int sum = 0;
        int arr[a];
        for(int i=0; i<a; i++)cin>>arr[i];
        int even=0,odd=0;
        for(int i=0; i<a; i++)
        {
            if(arr[i]&1) odd++;
            else even++;
        }
        if((odd&1)) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--){
        int a,b;
        cin>>a>>b;
        int sum = 0;
        int arr[a];
        for(int i=0; i<a; i++)cin>>arr[i];
        int even=0,odd=0;
        for(int i=0; i<a; i++)
        {
            if(arr[i]&1) odd++;
            else even++;
        }
        if((odd+even)&1) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--){
        int a,b;
        cin>>a>>b;
        int sum = 0;
        int arr[a];
        for(int i=0; i<a; i++)cin>>arr[i];
        int even=0,odd=0;
        for(int i=0; i<a; i++)
        {
            if(arr[i]&1) odd++;
            else even++;
        }
        if(odd==0){
            cout<<"NO"<<endl;
            return 0;
        }
        for(int i=1; i<=odd; i+=2)
        {
            if(i>b)break;
            if((a-i)<=even)
            {
                cout<<"Yes"<<endl;
                return 0;
            }
        }
        cout<<"No"<<endl;
}
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin>>t;
    while(t--){
        int a,b;
        cin>>a>>b;
        int sum = 0;
        int arr[a];
        for(int i=0; i<a; i++)cin>>arr[i];
        int even=0,odd=0;
        for(int i=0; i<a; i++)
        {
            if((arr[i]%2==1)&&arr[i]>1) odd++;
            else even++;
        }
        if((odd&1)) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int solve();
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        solve();
    }
}
int solve()
{
    int a,b;
    cin>>a>>b;
    int sum = 0;
    int arr[a];
    for(int i=0; i<a; i++)
        cin>>arr[i];
    int even=0,odd=0;
    for(int i=0; i<a; i++)
    {
        if(arr[i]%2)
            odd++;
        else
            even++;
    }
    if(odd==0)
    {
        cout<<"NO"<<endl;
        return 0;
    }
    for(int i=1; i<=odd; i+=2)
    {
        if(i>b)
            break;
        if((a-i)<=even)
        {
            cout<<"YES"<<endl;
            return 0;
        }
    }
    cout<<"NO"<<endl;
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <set>
#include <bitset>
#define debug(x) cout << #x << ": " << x << endl;
#define debug2(x, y) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl;
#define debug3(x, y, z) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define debug4(a, b, c, d) cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define fio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MAX = 1e5+ 10;
const int inf = 0x7f7f7f7f;
const int inff = -1*inf;
const int mod = 1e10 + 1 ;
const long double PI =3.14159265358979323846;

int main()
{
    int t;
    cin >> t;
    while(t --) {
        int n, x;
        cin >> n >> x;
        int num, ji = 0, ou = 0;
        for(int i=0; i<n; i++) {
            cin >> num;
            if(num & 1) ji ++;
            else ou ++;
        }
        if(x == 1 && ji != 0) cout << "Yes" << endl;
        else if(x & 1) {
            // debug3(ji, ou, x/2)
            if(ji >= x / 2 && ou >= x/2+1) cout << "Yes" << endl;
            else cout << "No" << endl;
        }
        else {
            if(ji >= x/2 && ou >= x/2) cout << "Yes" << endl;
            else cout << "No" << endl;
        }
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <set>
#include <bitset>
#define debug(x) cout << #x << ": " << x << endl;
#define debug2(x, y) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl;
#define debug3(x, y, z) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define debug4(a, b, c, d) cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define fio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MAX = 1e5+ 10;
const int inf = 0x7f7f7f7f;
const int inff = -1*inf;
const int mod = 1e10 + 1 ;
const long double PI =3.14159265358979323846;

int t ;
ll n,x;
int  main()
{
    cin>>t;
    while(t--)
    {
        cin>>n>>x;
        ll ji=0,ou=0;
        ll num;
        for(int i=1; i<=n; i++){
            cin>>num;
            if(num&1) ji++;
            else ou++;
        }
        if(!ji) { cout << "No" << endl;
            continue;
        }
        if(x&1) {
            if(ji >= x) {
                cout << "Yes" << endl;
                continue;
            }
            if(!(ji&1)) ji--;
            if(ji+ou>=x) {
                    cout << "Yes" << endl;
                continue;
            }
            else cout << "No" <<endl ;continue;
        }
        else
        {
            if(!(ji&1)) ji--;
            if(ji>=x) x=1;
            else x-=ji;
            if(ou>=x) {
                    cout << "Yes" <<endl;
                continue;
            }
            else {
                cout << "No" <<endl;
                continue;
            }
        }
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <set>
#include <bitset>
#define debug(x) cout << #x << ": " << x << endl;
#define debug2(x, y) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl;
#define debug3(x, y, z) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define debug4(a, b, c, d) cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define fio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MAX = 1e5+ 10;
const int inf = 0x7f7f7f7f;
const int inff = -1*inf;
const int mod = 1e10 + 1 ;
const long double PI =3.14159265358979323846;

int main()
{
    int t;
    cin >> t;
    while(t --) {
        int n, x;
        cin >> n >> x;
        int num, ji = 0, ou = 0;
        for(int i=0; i<n; i++) {
            cin >> num;
            if(num & 1) ji ++;
            else ou ++;
        }
        if(x == 1 && ji != 0) cout << "Yes" << endl;
        else if(x & 1) {
            if(ji >= x / 2 && ou > x/2+1) cout << "Yes" << endl;
            else cout << "No" << endl;
        }
        else {
            if(ji >= x/2 && ou >= x/2) cout << "Yes" << endl;
            else cout << "No" << endl;
        }
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <set>
#include <bitset>
#define debug(x) cout << #x << ": " << x << endl;
#define debug2(x, y) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl;
#define debug3(x, y, z) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define debug4(a, b, c, d) cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define fio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MAX = 1e5+ 10;
const int inf = 0x7f7f7f7f;
const int inff = -1*inf;
const int mod = 1e10 + 1 ;
const long double PI =3.14159265358979323846;

int main()
{
    int t;
    cin >> t;
    while(t --) {
        int n, x;
        cin >> n >> x;
        int num;
        int ji = 0, ou = 0;
        for(int i=0; i<n; i++) {
            cin >> num;
            if(num & 1) ji ++;
            else ou ++;
        }

        if( !ji ) {
            cout << "No" << endl;
            continue ;
        }
        // if(x & 1) {
            if( !(ji & 1) ) ji --;
            x -= ji;
            if(ou >= x) cout << "Yes" << endl;
            else cout << "No" << endl;
        // }
        // else {
        //     if()
        // }
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <set>
#include <bitset>
#define debug(x) cout << #x << ": " << x << endl;
#define debug2(x, y) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl;
#define debug3(x, y, z) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define debug4(a, b, c, d) cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define fio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MAX = 1e5+ 10;
const int inf = 0x7f7f7f7f;
const int inff = -1*inf;
const int mod = 1e10 + 1 ;
const long double PI =3.14159265358979323846;

int t ;
ll n,x;
int  main()
{
    cin>>t;
    while(t--)
    {
        cin>>n>>x;
        ll ji=0,ou=0;
        ll num;
        for(int i=1; i<=n; i++){
            cin>>num;
            if(num&1) ji++;
            else ou++;
        }
        if(!ji) { cout << "No" <<endl;);
            continue;
        }
        if(x&1) {
            if(ji >= x) {
                cout << "Yes" << endl;
                continue;
            }
            if(!(ji&1)) ji--;
            if(ji+ou>=x) {
                    cout << "Yes" << endl;
                continue;
            }
            else cout << "No" <<endl ;continue;
        }
        else
        {
            if(!(ji&1)) ji--;
            if(ji>=x) x=1;
            else x-=ji;
            if(ou>=x) {
                    cout << "Yes" <<endl;
                continue;
            }
            else {
                cout << "No" <<endl;
                continue;
            }
        }
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <set>
#include <bitset>
#define debug(x) cout << #x << ": " << x << endl;
#define debug2(x, y) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl;
#define debug3(x, y, z) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define debug4(a, b, c, d) cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define fio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MAX = 1e5+ 10;
const int inf = 0x7f7f7f7f;
const int inff = -1*inf;
const int mod = 1e10 + 1 ;
const long double PI =3.14159265358979323846;

int main()
{
    int t;
    cin >> t;
    while(t --) {
        int n, x;
        cin >> n >> x;
        int num;
        int ji = 0, ou = 0;
        for(int i=0; i<n; i++) {
            cin >> num;
            if(num & 1) ji ++;
            else ou ++;
        }

        // if(x & 1) {
            if( !(ji & 1) ) ji --;
            x -= ji;
            if(ou >= x) cout << "Yes" << endl;
            else cout << "No" << endl;
        // }
        // else {
        //     if()
        // }
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <set>
#include <bitset>
#define debug(x) cout << #x << ": " << x << endl;
#define debug2(x, y) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl;
#define debug3(x, y, z) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define debug4(a, b, c, d) cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define fio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MAX = 1e5+ 10;
const int inf = 0x7f7f7f7f;
const int inff = -1*inf;
const int mod = 1e10 + 1 ;
const long double PI =3.14159265358979323846;

int main()
{
    int t;
    cin >> t;
    while(t --) {
        int n, x;
        cin >> n >> x;
        int num;
        int ji = 0, ou = 0;
        for(int i=0; i<n; i++) {
            cin >> num;
            if(num & 1) ji ++;
            else ou ++;
        }

        if( !ji ) {
            cout << "No" << endl;
            continue ;
        }
        // if(x & 1) {
            if( !(ji & 1) ) ji --;
            x -= ji;
            if(ji < 1) ji = 1;
            if(ou >= x) cout << "Yes" << endl;
            else cout << "No" << endl;
        // }
        // else {
        //     if()
        // }
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <set>
#include <bitset>
#define debug(x) cout << #x << ": " << x << endl;
#define debug2(x, y) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl;
#define debug3(x, y, z) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define debug4(a, b, c, d) cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define fio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MAX = 1e5+ 10;
const int inf = 0x7f7f7f7f;
const int inff = -1*inf;
const int mod = 1e10 + 1 ;
const long double PI =3.14159265358979323846;

int main()
{
    int t;
    cin >> t;
    while(t --) {
        int n, x;
        cin >> n >> x;
        int num;
        int ji = 0, ou = 0;
        for(int i=0; i<n; i++) {
            cin >> num;
            if(num & 1) ji ++;
            else ou ++;
        }

        if( !ji ) {
            cout << "No" << endl;
            continue ;
        }
        if(x & 1) {
            if(ji >= k) {
                cout << "Yes" << endl;
                continue ;
            }
            if( !(ji & 1) ) ji --;
            x -= ji;
            if(ji < 1) ji = 1;
            if(ou >= x) cout << "Yes" << endl;
            else cout << "No" << endl;
        }
        else {
            if( !(ji & 1) ) j --;
            if(ji >= x) x =1;
            else x -= ji;
            if(ou >= x) cout << "Yes" << endl;
            else cout << "No" << endl;
        }
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <set>
#include <bitset>
#define debug(x) cout << #x << ": " << x << endl;
#define debug2(x, y) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl;
#define debug3(x, y, z) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define debug4(a, b, c, d) cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define fio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MAX = 1e5+ 10;
const int inf = 0x7f7f7f7f;
const int inff = -1*inf;
const int mod = 1e10 + 1 ;
const long double PI =3.14159265358979323846;

int main()
{
    int t;
    cin >> t;
    while(t --) {
        int n, x;
        cin >> n >> x;
        int num;
        int ji = 0, ou = 0;
        for(int i=0; i<n; i++) {
            cin >> num;
            if(num & 1) ji ++;
            else ou ++;
        }

        if( !ji ) {
            cout << "No" << endl;
            continue ;
        }
        // if(ji >= x && (x & 1)) {
        //     cout << "Yes" << endl;
        //     continue ;
        // }
        if( !(ji & 1) ) ji --;
        x -= ji;
        if(ou >= 1 && ou >= x) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <set>
#include <bitset>
#define debug(x) cout << #x << ": " << x << endl;
#define debug2(x, y) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl;
#define debug3(x, y, z) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define debug4(a, b, c, d) cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define fio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MAX = 1e5+ 10;
const int inf = 0x7f7f7f7f;
const int inff = -1*inf;
const int mod = 1e10 + 1 ;
const long double PI =3.14159265358979323846;

int main()
{
    int t;
    cin >> t;
    while(t --) {
        int n, x;
        cin >> n >> x;
        int num;
        int ji = 0, ou = 0;
        for(int i=0; i<n; i++) {
            cin >> num;
            if(num & 1) ji ++;
            else ou ++;
        }

        if( !ji ) {
            cout << "No" << endl;
            continue ;
        }
        if(x & 1) {
            if(ji >= k) {
                cout << "Yes" << endl;
                continue ;
            }
            if( !(ji & 1) ) ji --;
            x -= ji;
            if(ji < 1) ji = 1;
            if(ou >= x) cout << "Yes" << endl;
            else cout << "No" << endl;
        }
        else {
            if( !(ji & 1) ) j --;
            if(ji >= x) k =1;
            else x -= ji;
            if(ou >= x) cout << "Yes" << endl;
            else cout << "No" << endl;
        }
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <set>
#include <bitset>
#define debug(x) cout << #x << ": " << x << endl;
#define debug2(x, y) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl;
#define debug3(x, y, z) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define debug4(a, b, c, d) cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define fio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MAX = 1e5+ 10;
const int inf = 0x7f7f7f7f;
const int inff = -1*inf;
const int mod = 1e10 + 1 ;
const long double PI =3.14159265358979323846;

int main()
{
    int t;
    cin >> t;
    while(t --) {
        int n, x;
        cin >> n >> x;
        int num;
        int ji = 0, ou = 0;
        for(int i=0; i<n; i++) {
            cin >> num;
            if(num & 1) ji ++;
            else ou ++;
        }

        if( !ji ) {
            cout << "No" << endl;
            continue ;
        }
        if(ji >= x && (x & 1)) {
            cout << "Yes" << endl;
            continue ;
        }
        if( !(ji & 1) ) ji --;
        x -= ji;
        if(ou >= 1 && ou >= x) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring
#define debug(x) cout << #x << ": " << x << endl;
#define debug2(x, y) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl;
#define debug3(x, y, z) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define debug4(a, b, c, d) cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define fio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MAX = 1e5+ 10;
const int inf = 0x7f7f7f7f;
const int inff = -1*inf;
const int mod = 1e10 + 1 ;
const long double PI =3.14159265358979323846;

int main()
{
    int t;
    cin >> t;
    while(t --) {
        int n, x;
        cin >> n >> x;
        int num;
        int ji = 0, ou = 0;
        for(int i=0; i<n; i++) {
            cin >> num;
            if(num & 1) ji ++;
            else ou ++;
        }

        if( !ji ) {
            cout << "No" << endl;
            continue ;
        }
        if(ji >= x && (x & 1)) {
            cout << "Yes" << endl;
            continue ;
        }
        if( !(ji & 1) ) ji --;
        x -= ji;
        if(ou >= 1 && ou >= x) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <memory.h>

using namespace std;

#define ABS(a) ((a>0)?a:-(a))
#define MIN(a,b) ((a<b)?(a):(b))
#define MAX(a,b) ((a<b)?(b):(a))
#define FOR(i,a,n) for (int i=(a);i<(n);++i)
#define FI(i,n) for (int i=0; i<(n); ++i)
#define pnt pair <int, int>
#define mp make_pair
#define PI 3.14159265358979
#define MEMS(a,b) memset(a,b,sizeof(a))
#define LL long long
#define U unsigned
vector<vector<pnt> > g;
int dp[3005][2];
int was[3005][2];
int num;
int a[3005][3005],b[3005][3005];
int was1[3005][2];
int dp1[3005][2];
int par[3005];
int how[3005];
int rec(int v, int f)
{
	if (v==num-1)
		return 0;
	if (was1[v][f]==num)
		return dp1[v][f];
	was1[v][f]=num;
	int res=2000000000;
	if (f==0)
		res=min(res,rec(v,1));
	if (f==0)
		res=min(res,(how[v]^1)+rec(par[v],f));
	else
		res=min(res,how[v]+rec(par[v],f));
	return dp1[v][f]=res;
}
int dfs(int v, int p, int f, int bad)
{
	if (was[v][f]==num)
		return dp[v][f];
	was[v][f]=num;
	int res=0;
	if (f==0)
	{
		FOR(i,0,g[v].size())
		{
			int to=g[v][i].first;
			if (to==p)
				continue;
			res+=g[v][i].second+dfs(to,v,0,bad);
		}
		return dp[v][f]=res;
	}
	else
	{
		res=2000000000;
		int cres1=rec(v,0)-bad;
		FOR(i,0,g[v].size())
		{
			int to=g[v][i].first;
			if (to==p)
				continue;
			cres1+=g[v][i].second+dfs(to,v,0,bad);
		}
		int cres2=2000000000;
		int sum=0;
		FOR(i,0,g[v].size())
		{
			int to=g[v][i].first;
			if (to==p)
				continue;
			int val=g[v][i].second;
			if (val==0)
			{
				a[v][i]=dfs(to,v,0,bad);
				b[v][i]=dfs(to,v,1,bad);
			}
			else
			{
				a[v][i]=val+dfs(to,v,0,bad+1);
				b[v][i]=val+dfs(to,v,1,bad+1);
			}
			sum+=a[v][i];
		}
		cres2=MIN(cres2,sum);
		FOR(i,0,g[v].size())
		{
			int to=g[v][i].first;
			if (to==p)
				continue;
			cres2=MIN(cres2,sum-a[v][i]+b[v][i]);
		}
		res=MIN(res,cres1);
		res=MIN(res,cres2);
	}
	return dp[v][f]=res;
}
void dfs2(int v, int p)
{
	FOR(i,0,g[v].size())
		if (g[v][i].first!=p)
		{
			par[g[v][i].first]=v;
			how[g[v][i].first]=g[v][i].second;
			dfs2(g[v][i].first,v);
		}
}
void gettest()
{
	freopen("out.txt","w",stdout);
	printf("3000\n");
	FOR(i,0,3000-1)
		printf("%d %d\n",1,i+2);
}
int main()
{
#ifdef Fcdkbear
    freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    double beg=clock();
#endif
	//gettest(); return 0;
	int n;
	scanf("%d",&n);
	g.resize(n);
	//a.resize(n);
	//b.resize(n);
	FOR(i,0,n-1)
	{
		int v1,v2;
		scanf("%d%d",&v1,&v2);
		v1--;
		v2--;
		g[v1].push_back(mp(v2,0));
		g[v2].push_back(mp(v1,1));
		/*a[v1].push_back(0);
		b[v1].push_back(0);
		a[v2].push_back(0);
		b[v2].push_back(0);*/
	}
	int res=2000000000;
	FOR(i,0,n)
	{
		num=i+1;
		dfs2(i,-1);
		res=min(res,dfs(i,-1,1,0));
	}
	cout<<res<<endl;
#ifdef Fcdkbear
    double end=clock();
    fprintf(stderr,"*** Total time = %.3lf ***\n",(end-beg)/CLOCKS_PER_SEC);
#endif
}


#include <functional>
#include <algorithm>
#include <stdexcept>
#include <iostream>
#include <sstream>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <cctype>
#include <vector>
#include <string>
#include <bitset>
#include <cmath>
#include <queue>
#include <stdio.h>
#include <stack>
#include <ctime>
#include <list>
#include <map>
#include <set>
#include <assert.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define TR(i,x) for(typeof(x.begin()) i=x.begin();i!=x.end();i++)
#define ALL(x) x.begin(),x.end()
#define SORT(x) sort(ALL(x))
#define CLEAR(x) memset(x,0,sizeof(x))
#define FILL(x,c) memset(x,c,sizeof(x))

using namespace std;

const double eps = 1e-8;

#define PB push_back
#define MP make_pair

typedef map<int,int> MII;
typedef map<string,int> MSI;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<long double> VD;
typedef pair<int,int> PII;
typedef long long int64;
typedef long long ll;
typedef unsigned int UI;
typedef long double LD;
typedef unsigned long long ULL;

int dp[3333][3][2];

struct Edge
{
    int u, v;
    bool reversed;

    Edge(int u, int v, bool reversed)
        : u(u), v(v), reversed(reversed)
    {
    }

    Edge()
    {
    }
};

vector<Edge> e[3333];

void dfs(int u, int fa)
{
    bool leaf = true;
    TR(it, e[u])
        if (it->v != fa)
        {
            leaf = false;
            dfs(it->v, u);
        }

    if (leaf)
    {
        dp[u][0][0] = 0;
        dp[u][1][1] =  dp[u][1][0] = 0;
        return;
    }

    dp[u][0][0] = 0;
    TR(it, e[u])
        if (it->v != fa)
        {
            dp[u][0][0] += dp[it->v][0][0] + (int)it->reversed;
        }

    int mini0 = 0, mini1 = 0;

    TR(it, e[u])
        if (it->v != fa)
        {
            int sub = dp[it->v][0][0] + (int)it->reversed;
            mini1 = min(mini1, -sub + dp[it->v][1][1] + 1 - (int)it->reversed);
            mini0 = min(mini0, -sub + dp[it->v][1][1]);
            mini0 = min(mini0, -sub + (int)it->reversed + dp[it->v][1][0]);
        }

    dp[u][1][1] = dp[u][0][0] + mini1;
    dp[u][1][0] = dp[u][0][0] + mini0;

    TR(it, e[u])
        if (it->v != fa)
        {
            int sub = dp[it->v][0][0] + (int)it->reversed;
            mini0 = min(mini0, -sub + dp[it->v][2][1] + 1 - (int)it->reversed);
        }

    dp[u][2][1] = min(dp[u][2][1], dp[u][0][0] + mini0);

    vector<Edge> edge;

    TR(it, e[u])
        if (it->v != fa)
        {
            edge.PB(*it);
        }

    mini0 = 0x3f3f3f3f;
    TR(it, edge)
    {
        int sub = dp[it->v][0][0] + (int)it->reversed;
        dp[u][2][1] = min(dp[u][2][1], dp[u][0][0] + mini0 - sub + dp[it->v][1][1]);
        mini0 = min(mini0, -sub + dp[it->v][1][0] + (int)it->reversed);
        mini0 = min(mini0, -sub + dp[it->v][1][1]);
    }

    reverse(ALL(edge));

    mini0 = 0x3f3f3f3f;
    TR(it, edge)
    {
        int sub = dp[it->v][0][0] + (int)it->reversed;
        dp[u][2][1] = min(dp[u][2][1], dp[u][0][0] + mini0 - sub + dp[it->v][1][1]);
        mini0 = min(mini0, -sub + dp[it->v][1][0] + (int)it->reversed);
        mini0 = min(mini0, -sub + dp[it->v][1][1]);
    }
}

int main()
{
    int n;
    scanf("%d", &n);
    REP(i, n-1)
    {
        int u, v;
        scanf("%d%d", &u, &v);
        --u, --v;
        e[u].PB(Edge(u, v, false));
        e[v].PB(Edge(v, u, true));
    }

    FILL(dp, 0x3f);
    dfs(0, -1);
    int ans = 0x3f3f3f3f;
    REP(i, 3) ans = min(ans, dp[0][i][1]);

    cout << ans << endl;

    return 0;
}


#include <functional>
#include <algorithm>
#include <stdexcept>
#include <iostream>
#include <sstream>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <cctype>
#include <vector>
#include <string>
#include <bitset>
#include <cmath>
#include <queue>
#include <stdio.h>
#include <stack>
#include <ctime>
#include <list>
#include <map>
#include <set>
#include <assert.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define TR(i,x) for(typeof(x.begin()) i=x.begin();i!=x.end();i++)
#define ALL(x) x.begin(),x.end()
#define SORT(x) sort(ALL(x))
#define CLEAR(x) memset(x,0,sizeof(x))
#define FILL(x,c) memset(x,c,sizeof(x))

using namespace std;

const double eps = 1e-8;

#define PB push_back
#define MP make_pair

typedef map<int,int> MII;
typedef map<string,int> MSI;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<long double> VD;
typedef pair<int,int> PII;
typedef long long int64;
typedef long long ll;
typedef unsigned int UI;
typedef long double LD;
typedef unsigned long long ULL;

int dp[3333][3][2];

struct Edge
{
    int u, v;
    bool reversed;

    Edge(int u, int v, bool reversed)
        : u(u), v(v), reversed(reversed)
    {
    }

    Edge()
    {
    }
};

vector<Edge> e[3333];

void dfs(int u, int fa)
{
    bool leaf = true;
    TR(it, e[u])
        if (it->v != fa)
        {
            leaf = false;
            dfs(it->v, u);
        }

    if (leaf)
    {
        dp[u][0][0] = 0;
        dp[u][1][1] =  dp[u][1][0] = 0;
        return;
    }

    dp[u][0][0] = 0;
    TR(it, e[u])
        if (it->v != fa)
        {
            dp[u][0][0] += dp[it->v][0][0] + (int)it->reversed;
        }

    int mini0 = 0, mini1 = 0;

    TR(it, e[u])
        if (it->v != fa)
        {
            int sub = dp[it->v][0][0] + (int)it->reversed;
            mini1 = min(mini1, -sub + dp[it->v][1][1] + 1 - (int)it->reversed);
            mini0 = min(mini0, -sub + dp[it->v][1][0]);
        }

    dp[u][1][1] = dp[u][0][0] + mini1;
    dp[u][1][0] = dp[u][0][0] + mini0;

    TR(it, e[u])
        if (it->v != fa)
        {
            int sub = dp[it->v][0][0] + (int)it->reversed;
            mini0 = min(mini0, -sub + dp[it->v][2][1] + 1 - (int)it->reversed);
        }

    dp[u][2][1] = min(dp[u][2][1], dp[u][0][0] + mini0);

    vector<Edge> edge;

    TR(it, e[u])
        if (it->v != fa)
        {
            edge.PB(*it);
        }

    mini0 = 0x3f3f3f3f;
    TR(it, edge)
    {
        int sub = dp[it->v][0][0] + (int)it->reversed;
        dp[u][2][1] = min(dp[u][2][1], dp[u][0][0] + mini0 - sub + dp[it->v][1][1]);
        mini0 = min(mini0, -sub + dp[it->v][1][0]);
    }

    reverse(ALL(edge));

    mini0 = 0x3f3f3f3f;
    TR(it, edge)
    {
        int sub = dp[it->v][0][0] + (int)it->reversed;
        dp[u][2][1] = min(dp[u][2][1], dp[u][0][0] + mini0 - sub + dp[it->v][1][1]);
        mini0 = min(mini0, -sub + dp[it->v][1][0]);
    }
}

int main()
{
    int n;
    scanf("%d", &n);
    REP(i, n-1)
    {
        int u, v;
        scanf("%d%d", &u, &v);
        --u, --v;
        e[u].PB(Edge(u, v, false));
        e[v].PB(Edge(v, u, true));
    }

    FILL(dp, 0x3f);
    dfs(0, -1);
    int ans = 0x3f3f3f3f;
    REP(i, 3) REP(j, 2) ans = min(ans, dp[0][i][j]);

    cout << ans << endl;

    return 0;
}


#include <functional>
#include <algorithm>
#include <stdexcept>
#include <iostream>
#include <sstream>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <cctype>
#include <vector>
#include <string>
#include <bitset>
#include <cmath>
#include <queue>
#include <stdio.h>
#include <stack>
#include <ctime>
#include <list>
#include <map>
#include <set>
#include <assert.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define TR(i,x) for(typeof(x.begin()) i=x.begin();i!=x.end();i++)
#define ALL(x) x.begin(),x.end()
#define SORT(x) sort(ALL(x))
#define CLEAR(x) memset(x,0,sizeof(x))
#define FILL(x,c) memset(x,c,sizeof(x))

using namespace std;

const double eps = 1e-8;

#define PB push_back
#define MP make_pair

typedef map<int,int> MII;
typedef map<string,int> MSI;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<long double> VD;
typedef pair<int,int> PII;
typedef long long int64;
typedef long long ll;
typedef unsigned int UI;
typedef long double LD;
typedef unsigned long long ULL;

int dp[3333][3][2];

struct Edge
{
    int u, v;
    bool reversed;

    Edge(int u, int v, bool reversed)
        : u(u), v(v), reversed(reversed)
    {
    }

    Edge()
    {
    }
};

vector<Edge> e[3333];

void dfs(int u, int fa)
{
    bool leaf = true;
    TR(it, e[u])
        if (it->v != fa)
        {
            leaf = false;
            dfs(it->v, u);
        }

    if (leaf)
    {
        dp[u][0][0] = 0;
        dp[u][1][1] =  dp[u][1][0] = 0;
        return;
    }

    dp[u][0][0] = 0;
    TR(it, e[u])
        if (it->v != fa)
        {
            dp[u][0][0] += dp[it->v][0][0] + (int)it->reversed;
        }

    int mini0 = 0, mini1 = 0;

    TR(it, e[u])
        if (it->v != fa)
        {
            int sub = dp[it->v][0][0] + (int)it->reversed;
            mini1 = min(mini1, -sub + dp[it->v][1][1] + 1 - (int)it->reversed);
            mini0 = min(mini0, -sub + dp[it->v][1][1]);
            mini0 = min(mini0, -sub + (int)it->reversed + dp[it->v][1][0]);
        }

    dp[u][1][1] = dp[u][0][0] + mini1;
    dp[u][1][0] = dp[u][0][0] + mini0;

    TR(it, e[u])
        if (it->v != fa)
        {
            int sub = dp[it->v][0][0] + (int)it->reversed;
            mini0 = min(mini0, -sub + dp[it->v][2][1] + 1 - (int)it->reversed);
        }

    dp[u][2][1] = min(dp[u][2][1], dp[u][0][0] + mini0);

    vector<Edge> edge;

    TR(it, e[u])
        if (it->v != fa)
        {
            edge.PB(*it);
        }

    mini0 = 0x3f3f3f3f;
    TR(it, edge)
    {
        int sub = dp[it->v][0][0] + (int)it->reversed;
        dp[u][2][1] = min(dp[u][2][1], dp[u][0][0] + mini0 - sub + dp[it->v][1][1]);
        mini0 = min(mini0, -sub + dp[it->v][1][0] + (int)it->reversed);
        mini0 = min(mini0, -sub + dp[it->v][1][1]);
    }

    reverse(ALL(edge));

    mini0 = 0x3f3f3f3f;
    TR(it, edge)
    {
        int sub = dp[it->v][0][0] + (int)it->reversed;
        dp[u][2][1] = min(dp[u][2][1], dp[u][0][0] + mini0 - sub + dp[it->v][1][1]);
        mini0 = min(mini0, -sub + dp[it->v][1][0] + (int)it->reversed);
        mini0 = min(mini0, -sub + dp[it->v][1][1]);
    }
}

int main()
{
    int n;
    scanf("%d", &n);
    REP(i, n-1)
    {
        int u, v;
        scanf("%d%d", &u, &v);
        --u, --v;
        e[u].PB(Edge(u, v, false));
        e[v].PB(Edge(v, u, true));
    }

    FILL(dp, 0x3f);
    dfs(0, -1);
    int ans = 0x3f3f3f3f;
    REP(i, 3) REP(j, 2) ans = min(ans, dp[0][i][j]);

    cout << ans << endl;

    return 0;
}


#include <functional>
#include <algorithm>
#include <stdexcept>
#include <iostream>
#include <sstream>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <cctype>
#include <vector>
#include <string>
#include <bitset>
#include <cmath>
#include <queue>
#include <stdio.h>
#include <stack>
#include <ctime>
#include <list>
#include <map>
#include <set>
#include <assert.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define TR(i,x) for(typeof(x.begin()) i=x.begin();i!=x.end();i++)
#define ALL(x) x.begin(),x.end()
#define SORT(x) sort(ALL(x))
#define CLEAR(x) memset(x,0,sizeof(x))
#define FILL(x,c) memset(x,c,sizeof(x))

using namespace std;

const double eps = 1e-8;

#define PB push_back
#define MP make_pair

typedef map<int,int> MII;
typedef map<string,int> MSI;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<long double> VD;
typedef pair<int,int> PII;
typedef long long int64;
typedef long long ll;
typedef unsigned int UI;
typedef long double LD;
typedef unsigned long long ULL;

int dp[3333][3][2];

struct Edge
{
    int u, v;
    bool reversed;

    Edge(int u, int v, bool reversed)
        : u(u), v(v), reversed(reversed)
    {
    }

    Edge()
    {
    }
};

vector<Edge> e[3333];

void dfs(int u, int fa)
{
    bool leaf = true;
    TR(it, e[u])
        if (it->v != fa)
        {
            leaf = false;
            dfs(it->v, u);
        }

    if (leaf)
    {
        dp[u][0][0] = 0;
        dp[u][1][1] =  dp[u][1][0] = 0;
        return;
    }

    dp[u][0][0] = 0;
    TR(it, e[u])
        if (it->v != fa)
        {
            dp[u][0][0] += dp[it->v][0][0] + (int)it->reversed;
        }

    int mini0 = 0, mini1 = 0;

    TR(it, e[u])
        if (it->v != fa)
        {
            int sub = dp[it->v][0][0] + (int)it->reversed;
            mini1 = min(mini1, -sub + dp[it->v][1][1] + 1 - (int)it->reversed);
            mini0 = min(mini0, -sub + dp[it->v][1][1]);
            mini0 = min(mini0, -sub + (int)it->reversed + dp[it->v][1][0]);
        }

    dp[u][1][1] = dp[u][0][0] + mini1;
    dp[u][1][0] = dp[u][0][0] + mini0;

    TR(it, e[u])
        if (it->v != fa)
        {
            int sub = dp[it->v][0][0] + (int)it->reversed;
            mini0 = min(mini0, -sub + dp[it->v][2][1] + 1 - (int)it->reversed);
        }

    dp[u][2][1] = min(dp[u][2][1], dp[u][0][0] + mini0);

    vector<Edge> edge;

    TR(it, e[u])
        if (it->v != fa)
        {
            edge.PB(*it);
        }

    mini0 = 0x3f3f3f3f;
    TR(it, edge)
    {
        int sub = dp[it->v][0][0] + (int)it->reversed;
        dp[u][2][1] = min(dp[u][2][1], dp[u][0][0] + mini0 - sub + dp[it->v][1][1] + 1 - (int)it->reversed);
        mini0 = min(mini0, -sub + dp[it->v][1][0] + (int)it->reversed);
        mini0 = min(mini0, -sub + dp[it->v][1][1]);
    }

    reverse(ALL(edge));

    mini0 = 0x3f3f3f3f;
    TR(it, edge)
    {
        int sub = dp[it->v][0][0] + (int)it->reversed;
        dp[u][2][1] = min(dp[u][2][1], dp[u][0][0] + mini0 - sub + dp[it->v][1][1] + 1 - (int)it->reversed);
        mini0 = min(mini0, -sub + dp[it->v][1][0] + (int)it->reversed);
        mini0 = min(mini0, -sub + dp[it->v][1][1]);
    }
}

int main()
{
    int n;
    scanf("%d", &n);
    REP(i, n-1)
    {
        int u, v;
        scanf("%d%d", &u, &v);
        --u, --v;
        e[u].PB(Edge(u, v, false));
        e[v].PB(Edge(v, u, true));
    }

    FILL(dp, 0x3f);
    dfs(0, -1);
    int ans = 0x3f3f3f3f;
    REP(i, 3) ans = min(ans, dp[0][i][1]);

    cout << ans << endl;

    return 0;
}


//By Lin
#include<cstdio>
#include<cstring>
#include<algorithm>
#define Rep(i,n) for(int i = 0; i<n; i++)
#define maxn 3005
using namespace std;

int     ecnt;
struct  Edge{
    int to;
    Edge *next;
}*mat[maxn],edges[maxn];
void    link(int x,int to){
    edges[ecnt].to = to;
    edges[ecnt].next = mat[x];
    mat[x] = &edges[ecnt++];
}

int     n,d[maxn],ans;
int     mark[maxn],L[maxn][2];

void    dfs(int x , int depth){
    if ( mark[x] ){
        if ( mark[x] == 1 ) {
            L[x][1] = max( L[x][0], depth );
            L[x][0] = min( L[x][0], depth );
        }
        else {
            ans += min( L[x][0] , depth );
            L[x][0] = max( L[x][0] , depth );
            if ( L[x][0] > L[x][1] ) swap( L[x][0] , L[x][1] );
        }
        mark[x] = 2;
        return;
    }
    else L[x][0] = depth;
    mark[x] = 1;
    for ( Edge *p = mat[x]; p ; p = p->next)
        dfs(p->to,depth+1);
}

int     main(){
    scanf("%d", &n );
    Rep(i,n-1){
        int x,y;
        scanf("%d%d", &x, &y );
        link( x, y );
        d[y]++;
    }
    ans = 0;
    for (int i = 1; i<=n; i++)
        if ( d[i] == 0 )
            dfs(i,0);
    bool flag = false;
    for (int i = 1 ,now = 0; i<=n; i++)
        if ( mark[i] == 2 ){
            flag = true;
            ans += min(  now , L[i][0] );
            now = max( now , L[i][0] );
        }
    if ( !flag ) ans ++;
    printf("%d\n" , ans );
    return 0;
}


//By Lin
#include<cstdio>
#include<cstring>
#include<algorithm>
#define Rep(i,n) for(int i = 0; i<n; i++)
#define maxn 3005
using namespace std;

int     ecnt;
struct  Edge{
    int to;
    Edge *next;
}*mat[maxn],edges[maxn];
void    link(int x,int to){
    edges[ecnt].to = to;
    edges[ecnt].next = mat[x];
    mat[x] = &edges[ecnt++];
}

int     n,d[maxn],ans;
int     mark[maxn],L[maxn][2];

void    dfs(int x , int depth){
    if ( mark[x] ){
        if ( mark[x] == 1 ) {
            L[x][1] = max( L[x][0], depth );
            L[x][0] = min( L[x][0], depth );
        }
        else {
            ans += min( L[x][0] , depth );
            L[x][0] = max( L[x][0] , depth );
            if ( L[x][0] > L[x][1] ) swap( L[x][0] , L[x][1] );
        }
        mark[x] = 2;
        return;
    }
    else L[x][0] = depth;
    mark[x] = 1;
    for ( Edge *p = mat[x]; p ; p = p->next)
        dfs(p->to,depth+1);
}

int     main(){
    scanf("%d", &n );
    Rep(i,n-1){
        int x,y;
        scanf("%d%d", &x, &y );
        link( x, y );
        d[y]++;
    }
    ans = 0;
    for (int i = 1; i<=n; i++)
        if ( d[i] == 0 ) dfs(i,0);
    for (int i = 1 ,now = 0; i<=n; i++)
        if ( mark[i] == 2 ){
            ans += min(  now , L[i][0] );
            now = max( now , L[i][0] );
        }
    printf("%d\n" , ans );
    return 0;
}


//By Lin
#include<cstdio>
#include<cstring>
#include<algorithm>
#define Rep(i,n) for(int i = 0; i<n; i++)
#define maxn 3005
#define inf  0x7fffffff
using namespace std;

int     ecnt;
struct  Edge{
    int to,w;
    Edge *next;
}*mat[maxn],edges[maxn*2];
void    link(int x,int to,int w){
    edges[ecnt].to = to;
    edges[ecnt].w  = w;
    edges[ecnt].next = mat[x];
    mat[x] = &edges[ecnt++];
}

int     n,dp[maxn][2];
void    dfs(int x,int father ){
    dp[x][0] = dp[x][1] = 0;
    int k = 0;
    for ( Edge *p = mat[x];p ; p = p->next ){
        int to = p->to;
        if ( to == father ) continue;
        dfs(to,x);
        dp[x][1] += dp[to][1]+(p->w^1);
        k = min( dp[to][0]+p->w-dp[to][1]-(p->w^1) , k );
    }
    dp[x][0] = dp[x][1] + k;
}

int     solve(int x){
    int tol = 0,g=0,h=0;
    for ( Edge *p = mat[x]; p ; p = p->next ){
        int to = p->to;
        dfs( to , x );
        tol += dp[to][1]+(p->w^1);
        int k = dp[to][0]+(p->w)-dp[to][1]-(p->w^1);
        if ( k < g ) h = g , g = k;
        else if ( k < h ) h = k;
    }
    return tol+g+h;
}
int     main(){
    scanf("%d", &n );
    Rep(i,n-1){
        int x,y;
        scanf("%d%d", &x, &y );
        link( x, y , 1 );
        link( y, x , 0 );
    }
    int ans = inf;
    for (int i = 1; i<=n; i++) {
        ans =min( ans , solve(i) );
    }
    printf("%d\n" , ans );
    return 0;
}


//By Lin
#include<cstdio>
#include<cstring>
#include<algorithm>
#define Rep(i,n) for(int i = 0; i<n; i++)
#define maxn 3005
using namespace std;

int     ecnt;
struct  Edge{
    int to;
    Edge *next;
}*mat[maxn],edges[maxn];
void    link(int x,int to){
    edges[ecnt].to = to;
    edges[ecnt].next = mat[x];
    mat[x] = &edges[ecnt++];
}

int     n,d[maxn],ans;
int     mark[maxn],L[maxn];

void    dfs(int x , int depth){
    if ( mark[x] ){
        if ( mark[x] == 2 ) ans += min( L[x] , depth );
        L[x] = max( L[x] , depth );
        mark[x] = 2;
        return;
    }
    else L[x] = depth;
    mark[x] = 1;
    for ( Edge *p = mat[x]; p ; p = p->next)
        dfs(p->to,depth+1);
}

int     main(){
    scanf("%d", &n );
    Rep(i,n-1){
        int x,y;
        scanf("%d%d", &x, &y );
        link( x, y );
        d[y]++;
    }
    ans = 0;
    for (int i = 1; i<=n; i++)
        if ( d[i] == 0 ) dfs(i,0);
    for (int i = 1 ,now = 0; i<=n; i++)
        if ( mark[i] == 2 ){
            ans += min(  now , L[i] );
            now = max( now , L[i] );
        }
    printf("%d\n" , ans );
    return 0;
}


// in the name of God

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

const int MAX_N = 3000 + 10;

vector <int> v[MAX_N], t1, t2;
int dp1[MAX_N], a[MAX_N][MAX_N], dp2[MAX_N], ras;
pair <int , int> p[MAX_N];
bool check[MAX_N];

void DFS(int x)
{
	check[x] = true;
	for(int i = 0; i < v[x].size(); i++)
	{
		if(check[v[x][i]] == false)
		{
			if(a[x][v[x][i]] == -1)
				dp1[ras]++;
			DFS(v[x][i]);
		}
	}
}
int xx = 0, root, rass;

void DFS2(int x , int y)
{
	check[x] = true;
	for(int i = 0; i < v[x].size(); i++)
	{
		if(check[v[x][i]] == false)
		{
			if(root == x && a[x][v[x][i]] == -1)
				dp2[x]++;
			if(v[x][i] == y)
			{
				xx = 1;
				root = y;
			}
			DFS2(v[x][i] , y);
			if(v[x][i] == y)
			{
				xx = 0;
				root = rass;
			}
			if(root == y)
				t1.push_back(v[x][i]);
			else
				t2.push_back(v[x][i]);
		}
	}
}
int main()
{
	int n, x, y;
	cin >> n;
	for(int i = 0; i < n - 1; i++)
	{
		cin >> p[i].first >> p[i].second;
		p[i].first--; p[i].second--;
		v[p[i].first].push_back(p[i].second);
		v[p[i].second].push_back(p[i].first);
		a[p[i].first][p[i].second] = 1;
		a[p[i].second][p[i].first] = -1;
	}
	for(int i = 0; i < n; i++)
	{
		ras = i;
		DFS(i);
		for(int j = 0; j < n; j++)
			check[j] = false;
	}
	int cnt = n;
	for(int i = 0; i < n - 1; i++)
	{
		int z;
		for(int j = 0; j < n; j++)
		{
			check[j] = false;
			dp2[i] = 0;
		}
		t1.clear();
		t2.clear();
		x = p[i].first; y = p[i].second;
		if(a[x][y] == -1)
			swap(y , x);
		root = x;
		rass = x;
		DFS2(x , y);
		int ans1 = dp1[x] - dp2[x], ans2 = dp1[y] - ans1;
		int mini1 = n, mini2 = n;
		for(int j = 0; j < t1.size(); j++)
		{
			mini1 = min(mini1 , dp1[t1[j]] - ans2);
		}
		mini1 = min(mini1 , dp2[x]);
		for(int j = 0; j < t2.size(); j++)
			mini2 = min(mini2 , dp1[t2[j]] - ans1);
		mini2 = min(mini2 , ans1);
		cnt = min(cnt , mini1 + mini2);
	}
	cout << cnt << endl;
	return 0;
}


// in the name of God

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

const int MAX_N = 3000 + 10;

vector <int> v[MAX_N], t1, t2;
int dp1[MAX_N], a[MAX_N][MAX_N], dp2[MAX_N], ras;
pair <int , int> p[MAX_N];
bool check[MAX_N];

void DFS(int x)
{
	check[x] = true;
	for(int i = 0; i < v[x].size(); i++)
	{
		if(check[v[x][i]] == false)
		{
			if(a[x][v[x][i]] == -1)
				dp1[ras]++;
			DFS(v[x][i]);
		}
	}
}
int xx = 0, root, rass;

void DFS2(int x , int y)
{
	check[x] = true;
	for(int i = 0; i < v[x].size(); i++)
	{
		if(check[v[x][i]] == false)
		{
			if(root == x && a[x][v[x][i]] == -1)
				dp2[x]++;
			if(v[x][i] == y)
			{
				xx = 1;
				root = y;
			}
			DFS2(v[x][i] , y);
			if(v[x][i] == y)
			{
				xx = 0;
				root = rass;
			}
			if(root == y)
				t1.push_back(v[x][i]);
			else
				t2.push_back(v[x][i]);
		}
	}
}
int main()
{
	int n, x, y;
	cin >> n;
	if(n == 1)
	{
		cout << 0 << endl;
		return 0;
	}
	for(int i = 0; i < n - 1; i++)
	{
		cin >> p[i].first >> p[i].second;
		p[i].first--; p[i].second--;
		v[p[i].first].push_back(p[i].second);
		v[p[i].second].push_back(p[i].first);
		a[p[i].first][p[i].second] = 1;
		a[p[i].second][p[i].first] = -1;
	}
	for(int i = 0; i < n; i++)
	{
		ras = i;
		DFS(i);
		for(int j = 0; j < n; j++)
			check[j] = false;
	}
	int cnt = n;
	for(int i = 0; i < n - 1; i++)
	{
		int z;
		for(int j = 0; j < n; j++)
		{
			check[j] = false;
			dp2[i] = 0;
		}
		t1.clear();
		t2.clear();
		x = p[i].first; y = p[i].second;
		if(a[x][y] == -1)
			swap(y , x);
		root = x;
		rass = x;
		DFS2(x , y);
		int ans1 = dp1[x] - dp2[x], ans2 = dp1[y] - ans1;
		int mini1 = n, mini2 = n;
		for(int j = 0; j < t1.size(); j++)
		{
			mini1 = min(mini1 , dp1[t1[j]] - ans2);
		}
		mini1 = min(mini1 , dp2[x]);
		for(int j = 0; j < t2.size(); j++)
			mini2 = min(mini2 , dp1[t2[j]] - ans1);
		mini2 = min(mini2 , ans1);
		cnt = min(cnt , mini1 + mini2);
	}
	cout << cnt << endl;
	return 0;
}


// in the name of God

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

const int MAX_N = 3000 + 10;

vector <int> v[MAX_N], t1, t2;
int dp1[MAX_N], a[MAX_N][MAX_N], dp2[MAX_N], ras;
pair <int , int> p[MAX_N];
bool check[MAX_N];

void DFS(int x)
{
	check[x] = true;
	for(int i = 0; i < v[x].size(); i++)
	{
		if(check[v[x][i]] == false)
		{
			if(a[x][v[x][i]] == -1)
				dp1[ras]++;
			DFS(v[x][i]);
		}
	}
}
int xx = 0, root, rass;

void DFS2(int x , int y)
{
	check[x] = true;
	for(int i = 0; i < v[x].size(); i++)
	{
		if(check[v[x][i]] == false)
		{
			if(root == rass && a[x][v[x][i]] == -1)
			{
				dp2[rass]++;
			}
			if(v[x][i] == y)
			{
				xx = 1;
				root = y;
			}
			DFS2(v[x][i] , y);
			if(v[x][i] == y)
			{
				xx = 0;
				root = rass;
			}
			if(root == y)
				t1.push_back(v[x][i]);
			else
				t2.push_back(v[x][i]);
		}
	}
}
int main()
{
	int n, x, y;
	cin >> n;
	if(n == 1)
	{
		cout << 0 << endl;
		return 0;
	}
	for(int i = 0; i < n - 1; i++)
	{
		cin >> p[i].first >> p[i].second;
		p[i].first--; p[i].second--;
		v[p[i].first].push_back(p[i].second);
		v[p[i].second].push_back(p[i].first);
		a[p[i].first][p[i].second] = 1;
		a[p[i].second][p[i].first] = -1;
	}
	for(int i = 0; i < n; i++)
	{
		ras = i;
		DFS(i);
		for(int j = 0; j < n; j++)
			check[j] = false;
	}
	int cnt = n;
	for(int i = 0; i < n - 1; i++)
	{
		int z;
		for(int j = 0; j < n; j++)
		{
			check[j] = false;
			dp2[j] = 0;
		}
		t1.clear();
		t2.clear();
		x = p[i].first; y = p[i].second;
		if(a[x][y] == -1)
			swap(y , x);
		root = x;
		rass = x;
		DFS2(x , y);
		int ansy = dp1[x] - dp2[x], ansx;
		ansx = dp2[x] + 1;
		int mini1 = n, mini2 = n;
		for(int j = 0; j < t1.size(); j++)
			mini1 = min(mini1 , dp1[t1[j]] - ansx);
		mini1 = min(mini1 , dp1[y] - ansx);
		for(int j = 0; j < t2.size(); j++)
			mini2 = min(mini2 , dp1[t2[j]] - ansy);
		mini2 = min(mini2 , dp2[x]);
		cnt = min(cnt , mini1 + mini2);
	}
	cout << cnt << endl;
	return 0;
}


#include<iostream>
#include<cstdio>
#include<vector>
using namespace std;

const int N = 5100;

int n, m, c[N][N], smin = 10000, p[N], s[N], cmin[N], rad;
vector<int> v[N], v1[N];
bool ver[N];

void dfs(int nod) {
	ver[nod] = true;

	for(int i = 0; i != v[nod].size(); ++i) if(!ver[v[nod][i]]) {
		p[v[nod][i]] = nod;
		v1[nod].push_back(v[nod][i]);

		dfs(v[nod][i]);

		s[nod] += s[v[nod][i]] + c[v[nod][i]][nod];
	}
}

void din(int nod) {

	cmin[nod] = s[nod];

	for(int i = 0; i < v1[nod].size(); ++i) {
		int el = v1[nod][i];
		din(el);

		cmin[nod] = min(cmin[nod], cmin[el] + c[nod][el] + s[nod] - s[el] - c[el][nod]);
	}

	smin = min(smin, cmin[nod] + s[rad] - s[nod] - c[nod][p[nod]]);
}

int main() {
	int i, a, b, j;

	//freopen("ttt", "r", stdin);

	cin >> n;

	for(i = 1; i!=n; ++i) {
		cin >> a >> b;

		v[a].push_back(b);
		v[b].push_back(a);
		c[a][b] = 1;
	}

	for(i = 1; i<=n; ++i) {

		for(j = 1; j<=n; ++j)
			v1[j].clear(), ver[j] = false, s[j] = 0, cmin[j] = 10000;
		rad = i;
		dfs(i);

		din(i);
	}
	smin = max(-1, 0);
	cout << smin;

	return 0;
}


#include<iostream>
#include<cstdio>
#include<vector>
using namespace std;

const int N = 5100;

int n, m, c[N][N], smin = 10000, p[N], s[N], cmin[N], rad;
vector<int> v[N], v1[N];
bool ver[N];

void dfs(int nod) {
	ver[nod] = true;

	for(int i = 0; i != v[nod].size(); ++i) if(!ver[v[nod][i]]) {
		p[v[nod][i]] = nod;
		v1[nod].push_back(v[nod][i]);

		dfs(v[nod][i]);

		s[nod] += s[v[nod][i]] + c[v[nod][i]][nod];
	}
}

void din(int nod) {

	cmin[nod] = s[nod];

	for(int i = 0; i < v1[nod].size(); ++i) {
		int el = v1[nod][i];
		din(el);

		cmin[nod] = min(cmin[nod], cmin[el] + c[nod][el] + s[nod] - s[el] - c[el][nod]);
	}

	smin = min(smin, cmin[nod] + s[rad] - s[nod] - c[nod][p[nod]]);
}

int main() {
	int i, a, b, j;

	//freopen("ttt", "r", stdin);

	cin >> n;

	for(i = 1; i!=n; ++i) {
		cin >> a >> b;

		v[a].push_back(b);
		v[b].push_back(a);
		c[a][b] = 1;
	}

	for(i = 1; i<=n; ++i) {

		for(j = 1; j<=n; ++j)
			v1[j].clear(), ver[j] = false, s[j] = 0, cmin[j] = 10000;
		rad = i;
		dfs(i);

		din(i);
	}

	cout << smin;

	return 0;
}


#include<iostream>
#include<cstdio>
#include<vector>
using namespace std;

const int N = 3100;

int n, m, c[N][N], smin = 10000, p[N], s[N], cmin[N], rad;
vector<int> v[N], v1[N];
bool ver[N];

void dfs(int nod) {
	ver[nod] = true;

	for(int i = 0; i != v[nod].size(); ++i) if(!ver[v[nod][i]]) {
		p[v[nod][i]] = nod;
		v1[nod].push_back(v[nod][i]);

		dfs(v[nod][i]);

		s[nod] += s[v[nod][i]] + c[v[nod][i]][nod];
	}
}

void din(int nod) {

	cmin[nod] = s[nod];

	for(int i = 0; i < v1[nod].size(); ++i) {
		int el = v1[nod][i];
		din(el);

		cmin[nod] = min(cmin[nod], cmin[el] + c[nod][el] + s[nod] - s[el] - c[el][nod]);
	}

	smin = min(smin, cmin[nod] + s[rad] - s[nod] - c[nod][p[nod]]);
}

int main() {
	int i, a, b, j;

	freopen("ttt", "r", stdin);

	cin >> n;

	for(i = 1; i!=n; ++i) {
		cin >> a >> b;

		v[a].push_back(b);
		v[b].push_back(a);
		c[a][b] = 1;
	}

	for(i = 1; i<=n; ++i) {

		for(j = 1; j<=n; ++j)
			v1[j].clear(), ver[j] = false, s[j] = 0, cmin[j] = 10000;
		rad = i;
		dfs(i);

		din(i);
	}

	cout << smin;

	return 0;
}


#include<iostream>
#include<cstdio>
#include<vector>
using namespace std;

const int N = 5100;

int n, m, c[N][N], smin = 10000, p[N], s[N], cmin[N], rad;
vector<int> v[N], v1[N];
bool ver[N];

void dfs(int nod) {
	ver[nod] = true;

	for(int i = 0; i != v[nod].size(); ++i) if(!ver[v[nod][i]]) {
		p[v[nod][i]] = nod;
		v1[nod].push_back(v[nod][i]);

		dfs(v[nod][i]);

		s[nod] += s[v[nod][i]] + c[v[nod][i]][nod];
	}
}

void din(int nod) {

	cmin[nod] = s[nod];

	for(int i = 0; i < v1[nod].size(); ++i) {
		int el = v1[nod][i];
		din(el);

		cmin[nod] = min(cmin[nod], cmin[el] + c[nod][el] + s[nod] - s[el] - c[el][nod]);
	}

	smin = min(smin, cmin[nod] + s[rad] - s[nod] - c[nod][p[nod]]);
}

int main() {
	int i, a, b, j;

	//freopen("ttt", "r", stdin);

	cin >> n;

	for(i = 1; i!=n; ++i) {
		cin >> a >> b;

		v[a].push_back(b);
		v[b].push_back(a);
		c[a][b] = 1;
	}

	for(i = 1; i<=n; ++i) {

		for(j = 1; j<=n; ++j)
			v1[j].clear(), ver[j] = false, s[j] = 0, cmin[j] = 10000;
		rad = i;
		dfs(i);

		din(i);
	}
	smin = max(smin, 0);
	cout << smin;

	return 0;
}


#include<iostream>
#include<cstdio>
#include<vector>
using namespace std;

const int N = 3100;

int n, m, c[N][N], smin = 10000, p[N], s[N], cmin[N], rad;
vector<int> v[N], v1[N];
bool ver[N];

void dfs(int nod) {
	ver[nod] = true;

	for(int i = 0; i != v[nod].size(); ++i) if(!ver[v[nod][i]]) {
		p[v[nod][i]] = nod;
		v1[nod].push_back(v[nod][i]);

		dfs(v[nod][i]);

		s[nod] += s[v[nod][i]] + c[v[nod][i]][nod];
	}
}

void din(int nod) {

	if(!v1[nod].size())
		cmin[nod] = 0;

	for(vector<int>::iterator it = v1[nod].begin(); it != v1[nod].end(); ++it) {

		din(*it);

		cmin[nod] = min(min(cmin[nod], s[nod]), cmin[*it] + c[nod][*it] + s[nod] - s[*it] - c[*it][nod]);
	}

	smin = min(smin, cmin[nod] + s[rad] - s[nod] - c[nod][p[nod]]);
}

int main() {
	int i, a, b, j;

	//freopen("ttt", "r", stdin);

	cin >> n;

	for(i = 1; i!=n; ++i) {
		cin >> a >> b;

		v[a].push_back(b);
		v[b].push_back(a);
		c[a][b] = 1;
	}

	for(i = 1; i<=n; ++i) {

		for(j = 1; j<=n; ++j)
			v1[j].clear(), ver[j] = false, s[j] = 0, cmin[j] = 10000;
		rad = i;
		dfs(i);

		din(i);
	}

	cout << smin;

	return 0;
}


#include<iostream>
#include<cstdio>
#include<vector>
using namespace std;

const int N = 5100;

int n, m, c[N][N], smin = 10000, p[N], s[N], cmin[N], rad;
vector<int> v[N], v1[N];
bool ver[N];

void dfs(int nod) {
	ver[nod] = true;

	for(int i = 0; i != v[nod].size(); ++i) if(!ver[v[nod][i]]) {
		p[v[nod][i]] = nod;
		v1[nod].push_back(v[nod][i]);

		dfs(v[nod][i]);

		s[nod] += s[v[nod][i]] + c[v[nod][i]][nod];
	}
}

void din(int nod) {

	cmin[nod] = s[nod];

	for(int i = 0; i < v1[nod].size(); ++i) {
		int el = v1[nod][i];
		din(el);

		cmin[nod] = min(cmin[nod], cmin[el] + c[nod][el] + s[nod] - s[el] - c[el][nod]);
	}

	smin = min(smin, cmin[nod] + s[rad] - s[nod] - c[nod][p[nod]]);
}

int main() {
	int i, a, b, j;

	freopen("ttt", "r", stdin);

	cin >> n;

	for(i = 1; i!=n; ++i) {
		cin >> a >> b;

		v[a].push_back(b);
		v[b].push_back(a);
		c[a][b] = 1;
	}

	for(i = 1; i<=n; ++i) {

		for(j = 1; j<=n; ++j)
			v1[j].clear(), ver[j] = false, s[j] = 0, cmin[j] = 10000;
		rad = i;
		dfs(i);

		din(i);
	}
	smin = max(-1, 0);
	cout << smin;

	return 0;
}