#include <bits/stdc++.h>
using namespace std;
const long long N = 2e6;
long long n, m, a, b;
map<long long, long long> mp;
long long used[N];
vector<long long> g[1001];
void dfs(long long v) {
  used[v] = 1;
  for (long long i = 0; i < g[v].size(); i++) {
    long long to = g[v][i];
    if (!used[to]) {
      dfs(to);
    }
  }
}
int main() {
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) {
    cin >> a >> b;
    for (long long j = a + 1; j <= b; j++) {
      g[a].push_back(j);
    }
  }
  dfs(0);
  if (!used[m]) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
}
