#include <bits/stdc++.h>
using namespace std;
int tc, n, m;
int main() {
  while (scanf("%d %d", &n, &m) == 2) {
    bool ok = 1, ok2 = 0;
    int a[200], b[200];
    for (int i = 1; i <= n; i++) {
      cin >> a[i] >> b[i];
      if (a[i] <= m && b[i] >= m) ok2 = 1;
    }
    if (a[1] != 0) ok = 0;
    int R = b[1];
    for (int i = 1; i <= n; i++) {
      if (i - 1 >= 1 && a[i] > R)
        ok = 0;
      else if (i - 1 >= 1 && a[i] <= R)
        R = max(R, b[i]);
    }
    printf((ok && ok2) ? "YES\n" : "NO\n");
  }
  return 0;
}
