#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
const double eps = 1e-6;
const double pi = acos(-1.0);
const int INF = 0x3f3f3f3f;
const long long LLINF = 0x3f3f3f3f3f3f3f3f;
const int maxn = 1e2 + 10;
const int maxm = 1e5 + 10;
int a[maxn], b[maxn];
int n, m;
int main(int argc, char const *argv[]) {
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i] >> b[i];
  int ri = b[0];
  if (a[0] > 0) {
    cout << "NO";
    return 0;
  }
  bool flag = true;
  for (int i = 1; i < n; i++) {
    if (ri >= a[i])
      ri = max(ri, b[i]);
    else
      flag = false;
  }
  if (flag && ri >= m)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
