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