#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m;
  cin >> n >> m;
  int a[n], b[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  int x = 0;
  for (int i = 0; i < n; i++) {
    if (x < a[i]) {
      cout << "NO" << (char)0x0A;
      return 0;
    }
    x = max(x, b[i]);
  }
  if (x >= m) {
    cout << "YES" << (char)0x0A;
    return 0;
  }
  cout << "NO" << (char)0x0A;
  return 0;
}
