#include <bits/stdc++.h>
using namespace std;
const int MAXN = 234567;
const int MAX_LOG = 18;
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  int ans = 0;
  while (n--) {
    int x, y;
    cin >> x >> y;
    if (ans >= x) ans = max(ans, y);
  }
  cout << (ans >= m ? "YES" : "NO") << endl;
  return 0;
}
