#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int ans = 0;
  int now = 0;
  for (int i = 1; i <= n; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    if (a > now) {
      cout << "NO" << endl;
      return 0;
    }
    now = now > b ? now : b;
  }
  if (now >= m)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
