#include <bits/stdc++.h>
using namespace std;
struct pq {
  int x, y;
};
bool cmp(pq p, pq q) {
  if (p.x != q.x)
    return p.x < q.x;
  else
    return p.y < q.y;
}
long long n, l, r, p, i, x, y, k, b[10009] = {0}, q;
pq a[1009];
int main() {
  cin >> n >> k;
  for (i = 1; i <= n; i++) {
    cin >> x >> y;
    a[i].x = x;
    a[i].y = y;
  }
  sort(a + 1, a + n + 1, cmp);
  if (a[1].x != 0) {
    cout << "NO\n";
    return 0;
  }
  x = a[1].x;
  y = a[1].y;
  if (x == 0 && y >= k) {
    cout << "YES\n";
    return 0;
  }
  for (i = 2; i <= n; i++) {
    if (y < a[i].x) {
      cout << "NO\n";
      return 0;
    }
    if (a[i].y == k) {
      cout << "YES\n";
      return 0;
    }
    x = a[i].x;
    q = a[i].y;
    y = max(y, q);
  }
  if (y < k) cout << "NO\n";
  return 0;
}
