#include <bits/stdc++.h>
using namespace std;
int const maxn = 1e5 + 10;
int const mod = 1e9 + 7;
int vis[maxn], a[maxn], b[maxn];
int main() {
  ios::sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  vis[0] = 1;
  for (int i = 1; i <= n; i++) {
    cin >> a[i] >> b[i];
  }
  for (int i = 0; i <= m; i++) {
    if (!vis[i]) continue;
    for (int j = 1; j <= n; j++) {
      if (a[j] == i) {
        for (int k = a[j]; k <= b[j]; k++) vis[k] = 1;
      }
    }
  }
  if (vis[m])
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
