#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int s[n];
  int e[n];
  for (int i = 0; i < n; i++) {
    cin >> s[i] >> e[i];
  }
  int i = n - 1;
  for (; i >= 0; i--)
    if (s[i] <= m && e[i] >= m) break;
  int j = i;
  while (i >= 0) {
    if (s[i] <= s[j] && e[i] >= s[j]) j = i;
    i--;
  }
  if (s[j] == 0)
    cout << "YES";
  else
    cout << "NO";
}
