#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, flag = 0;
  scanf("%d", &n), scanf("%d", &m);
  vector<pair<int, int> > vp;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    int a, b;
    scanf("%d", &a), scanf("%d", &b);
    if (cnt) b = (b >= vp[i - 1].second ? b : vp[i - 1].second);
    cnt++;
    vp.push_back(make_pair(a, b));
  }
  if (vp[0].first > 0) flag = 1;
  if (n == 1 && vp[0].second < m) flag = 1;
  for (int i = 1; i < n; i++) {
    if (vp[i].first > vp[i - 1].second) {
      flag = 1;
      break;
    }
    if (vp[i].second >= m) break;
  }
  if (flag || vp[n - 1].second < m)
    printf("NO\n");
  else
    printf("YES\n");
  return 0;
}
