#include <bits/stdc++.h>
using namespace std;
struct Node {
  int f, t;
};
Node node[100 + 10];
bool cmp(const Node& a, const Node& b) {
  return (a.f < b.f || ((a.f == b.f) && a.t <= b.t));
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> node[i].f;
    cin >> node[i].t;
  }
  int p = 0;
  for (int i = 0; i < n; i++) {
    if (p >= node[i].f && p < node[i].t) p = node[i].t;
  }
  if (p < m)
    cout << "NO";
  else
    cout << "YES";
  return 0;
}
