#include <bits/stdc++.h>
using namespace std;
using pii = pair<long long, long long>;
const long long MOD = 1e9 + 7;
const long long INF = 1 << 29;
const long long N = 2e5 + 10;
struct IOsetup {
  IOsetup() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cout << fixed << setprecision(20);
  }
} IO;
const long long MAX_N = 100 + 10;
long long p[N], sz[N];
long long get(long long x) {
  if (p[x] == x) return x;
  return p[x] = get(p[x]);
}
void unite(long long x, long long y) {
  x = get(x), y = get(y);
  if (x == y) return;
  if (sz[x] < sz[y]) swap(x, y);
  sz[x] += sz[y];
  p[y] = x;
}
int32_t main() {
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i <= m; i++) {
    p[i] = i;
    sz[i] = 1;
  }
  long long source = 0;
  long long dest = m;
  while (n--) {
    long long l, r;
    cin >> l >> r;
    for (long long i = l; i <= r; i++) unite(l, i);
  }
  bool ok = get(source) == get(dest);
  cout << (ok ? "YES" : "NO") << endl;
}
