#include <bits/stdc++.h>
using namespace std;
int N, M, i, j;
int a, b, v[105];
bool ok = true;
int main() {
  cin >> N >> M;
  for (i = 1; i <= N; i++) {
    cin >> a >> b;
    a++;
    v[a]++;
    v[b + 1]--;
  }
  for (i = 1; i <= M; i++) {
    v[i] += v[i - 1];
    if (v[i] == 0) ok = false;
  }
  if (ok == true)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
