#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, i;
  cin >> n >> m;
  pair<int, int> p[n];
  for (i = 0; i < n; i++) {
    cin >> p[i].first >> p[i].second;
  }
  sort(p, p + n);
  int x = 0;
  for (i = 0; i < n; i++) {
    if (p[i].first > x) {
      break;
    }
    x = max(x, p[i].second);
  }
  if (x >= m) {
    cout << "YES";
  } else {
    cout << "NO";
  }
}
