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

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int n, k;
	cin >> n >> k;
	
	int a, b; bool res = true;
	cin >> a;
	
	while (a != 0) {
		cin >> b;
		
		if (b == k) {res = false;}
		
		cin >> a;
		
	}
	
	if (res) {
		cout << "Yes";
	} else {
		cout << "No";
	}
	return 0;
}