#include <bits/stdc++.h>
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  int i;
  int a, b;
  int max = 0;
  int flag = 0;
  for (i = 0; i < n; i++) {
    scanf("%d %d", &a, &b);
    if (max > (a - 1))
      if (b > max)
        max = b;
      else
        max = max;
    else
      flag = 1;
  }
  if (flag == 0 && max >= m)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
