#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  int a, b;
  string s;
  cin >> n >> m;
  int maxus = 0;
  for (int i = 0; i < (n); i++) {
    cin >> a >> b;
    if (maxus >= a) {
      maxus = max(b, maxus);
    }
  }
  if (maxus >= m)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
