#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int bada, chota, f, a, b;
  bada = chota = 0;
  for (int i = 0; i <= n - 1; i++) {
    cin >> a >> b;
    if (a > bada) {
      cout << "NO";
      return 0;
    }
    if (b >= m) {
      cout << "YES";
      return 0;
    }
    bada = max(max(a, b), bada);
    chota = min(min(a, b), chota);
  }
  if (bada < m)
    cout << "NO";
  else
    cout << "YES";
  return 0;
}
