#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m;
  cin >> n >> m;
  int x = 0, y = 0, l, r;
  while (n--) {
    cin >> l >> r;
    if (l <= y) {
      if (r >= y) y = r;
    }
  }
  if (y >= m)
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
