#include <bits/stdc++.h>
using namespace std;
int max(int a, int b) { return (a > b) ? a : b; }
const int MAXN = 200031;
int c[MAXN];
vector<int> edges[MAXN];
int dfs(int u, int last) {
  int res = 0;
  if (c[u] != last) res = 1;
  for (auto x : edges[u]) {
    res += dfs(x, c[u]);
  }
  return res;
}
int a[1000];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  int x, y;
  int cur = 0;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    if (cur < x) {
      cout << "NO";
      return 0;
    }
    cur = max(cur, y);
    if (cur >= m) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
