#include <bits/stdc++.h>
using namespace std;
inline long long MAX2(long long a, long long int b) {
  return (a) > (b) ? (a) : (b);
}
inline long long MAX3(long long a, long long b, long long c) {
  return (a) > (b) ? ((a) > (c) ? (a) : (c)) : ((b) > (c) ? (b) : (c));
}
inline long long MIN2(long long a, long long b) {
  return (a) < (b) ? (a) : (b);
}
inline long long MIN3(long long a, long long b, long long c) {
  return (a) < (b) ? ((a) < (c) ? (a) : (c)) : ((b) < (c) ? (b) : (c));
}
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m, i, j;
  cin >> n >> m;
  int a[n], b[n];
  int prea, preb;
  int mar = 0;
  cin >> a[0] >> b[0];
  prea = a[0];
  preb = b[0];
  mar = b[0];
  if (a[0] > 0) {
    cout << "NO"
         << "\n";
  } else if (n == 1 && b[0] < m) {
    cout << "NO"
         << "\n";
  } else {
    int c = 0;
    int r = 0;
    for (i = 1; i < n; i++) {
      cin >> a[i] >> b[i];
      if (a[i] <= mar) {
        mar = MAX2(mar, b[i]);
      } else {
        c++;
      }
      prea = a[i];
      preb = b[i];
    }
    if (c == 0 && mar >= m) {
      cout << "YES"
           << "\n";
    } else {
      cout << "NO"
           << "\n";
    }
  }
}
