#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> v(n);
  for (auto &x : v) cin >> x.first >> x.second;
  pair<int, int> temp = v.front();
  if (temp.first != 0) {
    cout << "NO" << endl;
    return 0;
  }
  for (int i = 1; i < n; ++i) {
    if (temp.second < v[i].first) {
      cout << "NO" << endl;
      return 0;
    }
    temp.second = max(v[i].second, temp.second);
  }
  cout << (temp.second >= m ? "YES" : "NO") << endl;
  return 0;
}
