#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int R = 0;
  for (int i = 0; i < n; i++) {
    int l, r;
    cin >> l >> r;
    if (l <= R) {
      R = max(r, R);
    }
  }
  if (R >= m) {
    cout << "YES";
  } else {
    cout << "NO";
  }
}
