#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int M = 1e9 + 7;
long long a[N];
long long b[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  if (a[0] != 0) return cout << "NO", 0;
  for (int i = 1; i < n; i++) {
    if (a[i] > b[i - 1]) return cout << "NO", 0;
    b[i] = max(b[i - 1], b[i]);
  }
  if (b[n - 1] != m) return cout << "NO", 0;
  cout << "YES";
}
