#include <bits/stdc++.h>
using namespace std;
int n, c, r, m, w, px, py;
int main() {
  cin >> n >> m;
  pair<int, int> A[n];
  for (int i = 0; i < n; ++i) cin >> A[i].first >> A[i].second;
  for (int i = 0; i < n; ++i) {
    if (A[i].first <= py && A[i].first >= px && A[i].second > py)
      py = A[i].second;
  }
  if (py >= m)
    return cout << "YES", 0;
  else
    return cout << "NO", 0;
}
