#include <bits/stdc++.h>
using namespace std;
int main() {
  {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
  };
  long long n, m;
  cin >> n >> m;
  vector<pair<long long, long long>> v;
  for (long long i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    v.push_back({x, y});
  }
  bool ok = 1;
  sort(v.begin(), v.end());
  long long l = 0, r = 0;
  for (long long i = 0; i < n; i++) {
    if (i == 0)
      l = v[i].first, r = v[i].second;
    else {
      long long x = v[i].first, y = v[i].second;
      if (x > r) {
        ok = 0;
      } else {
        r = max(r, y);
      }
    }
  }
  if (m < l || l > 0) ok = 0;
  if (m > r) ok = 0;
  if (ok)
    cout << "YES\n";
  else
    cout << "NO\n";
}
