#include <bits/stdc++.h>
const int MAXN = 100 + 10;
int N, M;
int L[MAXN], R[MAXN];
int sum[MAXN];
bool visited[MAXN];
int main() {
  register int i, j;
  scanf("%d%d", &N, &M);
  for (i = 1; i <= N; ++i) {
    scanf("%d%d", L + i, R + i);
    for (j = 1; j < i; ++j)
      if (L[j] <= L[i] && L[i] <= R[j] && visited[j]) visited[i] = 1;
    if (L[i] == 0) visited[i] = 1;
    if (visited[i])
      for (j = L[i]; j <= R[i]; ++j) sum[j] = 1;
  }
  for (i = 0; i <= M; ++i)
    if (!sum[i]) return 0 * puts("NO");
  puts("YES");
  return 0;
}
