#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> adj[1001];
int vis[1001];
void dfs(int n) {
  if (vis[n] == 1) return;
  vis[n] = 1;
  for (int i = 0; i < adj[n].size(); i++) {
    dfs(adj[n][i]);
  }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    int l, r;
    cin >> l >> r;
    for (int j = l; j < r; j++) {
      adj[j].push_back(j + 1);
    }
  }
  dfs(0);
  if (vis[m] == 1) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
}
