#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000000;
bool cmp(pair<int, int> a, pair<int, int> b) { return a.second < b.second; }
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<pair<int, int> > v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i].first >> v[i].second;
  }
  sort(v.begin(), v.end());
  if (v[0].first != 0) {
    cout << "NO\n";
    return 0;
  }
  int r = v[0].second;
  bool ok = true;
  for (int i = 1; i < n; i++) {
    if (v[i].first <= r) {
      r = max(r, v[i].second);
    }
  }
  if (r >= m) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
}
