#include <bits/stdc++.h>
using namespace std;
bool mysort(const pair<int64_t, int64_t> &a, const pair<int64_t, int64_t> &b) {
  if (a.first != b.first)
    return (a.first < b.first);
  else
    return (a.second > b.second);
}
int64_t gcd(int64_t a, int64_t b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
void show_vec(vector<int64_t> &v) {
  cout << v.size() << "\n";
  for (int64_t i = 0; i < v.size(); i++) cout << v[i] << " ";
  cout << "\n";
}
bool check_prime(int64_t n) {
  if (n <= 1) return false;
  if (n < 4) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (int64_t i = 5; i * i <= n; i += 6) {
    if (n % i == 0 || n % (i + 2) == 0) return false;
  }
  return true;
}
void solve() {
  int64_t n, m, i, a, b, j;
  cin >> n >> m;
  vector<bool> v(m + 5, true);
  for (i = 0; i < n; i++) {
    cin >> a >> b;
    if (i > 0 && v[a]) {
      cout << "NO\n";
      return;
    }
    for (j = a; j <= b; j++) v[j] = false;
  }
  for (i = 0; i <= m; i++)
    if (v[i]) {
      cout << "NO\n";
      return;
    }
  cout << "YES\n";
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
