#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
void read(long long arr[], long long n) {
  for (long long i = 0; i < n; ++i) cin >> arr[i];
}
void printv(vector<long long> arr, long long n) {
  for (long long i = 0; i < n; ++i) cout << arr[i] << " ";
  cout << endl;
}
void print(long long arr[], long long n) {
  for (long long i = 0; i < n; ++i) cout << arr[i] << " ";
  cout << endl;
}
bool isPrime(long long n) {
  bool flag = 1;
  for (long long i = 2; i <= sqrt(n); ++i) {
    if (n % i == 0) {
      flag = 0;
      break;
    }
  }
  return (flag ? 1 : 0);
}
long long power(long long x, long long y) {
  long long res = 1;
  while (y) {
    if (y & 1) res = (res * x) % 1000000007;
    x = (x * x) % 1000000007;
    y >>= 1;
  }
  return res;
}
void test_case() {
  long long n, m, i, j, k;
  vector<pair<long long, long long>> p;
  cin >> n >> m;
  long long mx = 0;
  for (i = 0; i < n; ++i) {
    long long x, y;
    cin >> x >> y;
    p.push_back({x, y});
    mx = max(mx, y);
  }
  if (p[0].first != 0 || mx < m) {
    cout << "NO\n";
    return;
  }
  mx = p[0].second;
  for (i = 1; i < n; ++i) {
    if (p[i].first > mx) {
      cout << "NO\n";
      return;
    }
    if (p[i].second >= m) {
      cout << "YES\n";
      return;
    }
    mx = max(p[i].second, mx);
  }
  cout << "YES\n";
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) test_case();
  return 0;
}
