#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  int a, b;
  scanf("%d %d", &a, &b);
  int f = 0;
  if (a != 0) f = 2;
  if (m >= a && m <= b && f == 0) f = 1;
  n--;
  while (n) {
    int x, y;
    scanf("%d %d", &x, &y);
    if (x > b && f == 0) {
      f = 2;
    }
    if (y >= m && f == 0) {
      f = 1;
    }
    b = max(b, y);
    n--;
  }
  if (f == 1)
    printf("YES");
  else
    printf("NO");
  return 0;
}
