#include <bits/stdc++.h>
using namespace std;
map<int, int> m;
int main() {
  int n, m;
  cin >> n >> m;
  int arr[m];
  for (int i = 0; i < m; i++) arr[i] = 0;
  int l, r;
  for (int i = 0; i < n; i++) {
    cin >> l >> r;
    arr[l]++;
    arr[r]--;
  }
  int com[m];
  com[0] = arr[0];
  for (int i = 1; i < m; i++) {
    com[i] = com[i - 1] + arr[i];
  }
  for (int i = 0; i < m; i++) {
    if (com[i] <= 0) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES";
}
