#include <bits/stdc++.h>
using namespace std;
int main() {
  int l, n, m, ctr = 0;
  l = n;
  cin >> n >> m;
  int a, b, prev = 0;
  while (n--) {
    cin >> a >> b;
    if (prev >= a) {
      prev = max(prev, b);
    }
  }
  if (prev >= m) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
