#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long modexp(long long x, long long n) {
  if (n == 0) return 1;
  if (n % 2 == 0) {
    long long y = modexp(x, n / 2) % mod;
    return (y * y) % mod;
  }
  return (x * modexp(x, n - 1) % mod) % mod;
}
int a[500];
int main() {
  int n, m, x, y;
  scanf("%d%d", &n, &m);
  a[0] = 1;
  int flag = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &x, &y);
    if (a[x] != 1) {
      flag = 1;
    }
    for (int i = x; i <= y; i++) a[i] = 1;
  }
  if (flag == 0 && a[m] == 1)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
