#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  pair<long long, long long> p[n];
  for (long long i = 0; i < n; i++) {
    cin >> p[i].first >> p[i].second;
  }
  long long a[m + 1];
  for (long long i = 0; i <= m; i++) {
    a[i] = 0;
  }
  if (p[0].first != 0) {
    cout << "NO" << endl;
  } else {
    long long prev = 0;
    bool op = true;
    for (long long i = 0; i < n; i++) {
      if (p[i].first <= prev) {
        prev = max(prev, p[i].second);
      } else {
        op = false;
        break;
      }
    }
    if (op && prev == m) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}
