#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y, z;
} d[100005];
bool cmp(node a, node b) {
  if (a.x != b.x)
    return a.x < b.x;
  else
    return a.y < b.y;
}
int main() {
  int n, m;
  while (cin >> n >> m) {
    for (int i = 0; i < n; i++) {
      cin >> d[i].x >> d[i].y;
    }
    sort(d, d + n, cmp);
    int ce = 0;
    for (int i = 0; i < n; i++) {
      if (ce >= m) {
        break;
      }
      if (ce >= d[i].x) {
        ce = max(ce, d[i].y);
      } else {
        ce = -1;
        break;
      }
    }
    if (ce >= m)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
