#include <bits/stdtr1c++.h>

using namespace std;

pair<int, string> a[100005];
void move(int& l, int& r, int t, int id) {
	if (id == 0) {
		r--;
	} else if (id == 1) {
		l++;
	} else {
		if (t-l < r-t) {
			r--;
		} else {
			l++;
		}
	}
}

int main() {
	int n, p; cin >> n >> p;
	pair<int, string> target;
	for (int i = 0; i < n; i++) {
		cin >> a[i].first >> a[i].second;
		if (i == p-1) target = a[i];
	}
	sort(a, a+n);
	
	int t = -1;
	for (int i = 0; i < n; i++) {
		if (a[i] == target) t = i;
	}
	
	int l = 0, r = n-1, id = 0;
	while (r-l >= 1) {
		move(l, r, t, id);
		id = (id+1)%3;
	}
	if (l == t) {
		cout << "YES" << endl;
	} else {
		cout << "NO" << endl;
	}
	return 0;
}