#include <bits/stdc++.h>
using namespace std;
int main() {
  long long T, n, m;
  T = 1;
  while (T--) {
    cin >> n >> m;
    vector<pair<int, int> > a(n);
    for (int i = 0; i < n; i++) cin >> a[i].first >> a[i].second;
    sort(a.begin(), a.end());
    int cur = 0;
    int maxreach = 0;
    for (int i = 0; i < n; i++) {
      if (a[i].first <= maxreach) maxreach = max(maxreach, a[i].second);
    }
    if (maxreach >= m)
      cout << "YES";
    else
      cout << "NO";
    cout << endl;
  }
  return 0;
}
