#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long int n, m;
  cin >> n >> m;
  vector<long long int> v(n + 1), vv(n + 1);
  for (long long int i = 1; i <= n; i++) cin >> v[i] >> vv[i];
  long long int mx = 0;
  if (v[1] == 0) {
    for (long long int i = 1; i < n; i++) {
      if (vv[i] > mx) mx = vv[i];
      if (mx >= v[i + 1])
        continue;
      else {
        cout << "NO" << endl;
        return 0;
      }
    }
    if (vv[n] >= m || mx >= m)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  } else
    cout << "NO" << endl;
  return 0;
}
