#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, t = 0;
  cin >> n >> m;
  int a, b;
  for (int k = 1; k <= n; k++) {
    cin >> a >> b;
    if (a <= t) t = max(t, b);
  }
  if (t >= m)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
