#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  int a[220];
  int j;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= 2 * n; i++) {
    scanf("%d", &a[i]);
  }
  int k = 0;
  for (j = 1; j <= 2 * n - 1; j += 2) {
    if (a[j] <= k) k = max(k, a[j + 1]);
  }
  if (k >= m)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
