#include <bits/stdc++.h>
using namespace std;
int main(int argc, char* arg[]) {
  int n, m, a, b, c;
  scanf("%d %d", &n, &m);
  c = 0;
  while (n--) {
    scanf("%d %d", &a, &b);
    if (a <= c) c = max(b, c);
  }
  if (m <= c) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }
  return 0;
}
