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