#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  bool ok = false;
  vector<pair<int, int>> V;
  for (int i = 0; i < n; i++) {
    int l, r;
    cin >> l >> r;
    if (V.empty())
      V.push_back({l, r});
    else {
      if (V.back().second >= l) {
        auto last = V.back();
        V.pop_back();
        V.push_back({last.first, max(r, last.second)});
      } else
        V.push_back({l, r});
    }
  }
  ok = (m >= V[0].first && m <= V[0].second && V[0].first == 0);
  cout << (ok ? "YES" : "NO") << '\n';
  return 0;
}
