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