#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const double eps = 1e-6;
template <class T>
T gcd(T a, T b) {
  if (!b) return a;
  return gcd(b, a % b);
}
pair<int, int> a[1000];
int vis[1000];
int main() {
  int n, m;
  scanf("%d", &n);
  scanf("%d", &m);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i].first);
    scanf("%d", &a[i].second);
  }
  sort(a, a + n);
  vis[0] = 1;
  for (int i = 0; i < n; i++) {
    if (vis[a[i].first]) {
      for (int j = a[i].first; j <= a[i].second; j++) {
        vis[j] = 1;
      }
    }
  }
  if (vis[m])
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
