#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int arr[n][2];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 2; j++) {
      cin >> arr[i][j];
    }
  }
  if (arr[0][0] != 0) {
    cout << "NO";
    return 0;
  }
  int maxi = -10;
  for (int i = 0; i < n - 1; i++) {
    maxi = max(maxi, arr[i][1]);
    if (arr[i][1] < arr[i + 1][0]) {
      if (maxi < arr[i + 1][0]) {
        cout << "NO";
        return 0;
      }
    }
  }
  if (arr[n - 1][1] < m && maxi < m) {
    cout << "NO";
    return 0;
  }
  cout << "YES";
  return 0;
}
