#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, x, y, mx(0), cnt(0);
  cin >> n >> m;
  pair<int, int> p[n];
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    p[i] = make_pair(x, y);
  }
  for (int i = 0; i < n; i++) {
    if (p[i].first <= mx) {
      mx = max(mx, p[i].second);
    } else {
      return cout << "NO\n", 0;
    }
  }
  if (mx >= m)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
