#include <bits/stdc++.h>
using namespace std;
void XsliferX() {
  ios::sync_with_stdio(0);
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
}
int dx[9] = {1, -1, 0, 0, 1, -1, 1, -1, 0};
int dy[9] = {0, 0, 1, -1, 1, -1, -1, 1, 0};
int main() {
  XsliferX();
  int n, m, x, y, c = 0, mx = -1;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    if (x <= c) {
      c = max(y, c);
    } else {
      cout << "NO";
      return 0;
    }
  }
  if (c >= m)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
