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