#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int m, n, x, y, mx, pry, prx;
  cin >> n >> m;
  cin >> x >> y;
  mx = y;
  pry = y;
  prx = x;
  if (x != 0) {
    cout << "NO\n";
    return;
  }
  n--;
  while (n--) {
    cin >> x >> y;
    if (x <= mx) {
      mx = max(y, mx);
    }
  }
  if (mx >= m && prx == 0) {
    cout << "YES\n";
  } else
    cout << "NO\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t = 1;
  for (long long int tt = 1; tt < t + 1; tt++) {
    solve();
  }
}
