#include <bits/stdc++.h>
using namespace std;
int s[105];
int main() {
  int n, m, a1, b;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a1 >> b;
    for (int j = a1 + 1; j <= b; j++) {
      s[j]++;
    }
  }
  s[0]++;
  for (int i = 0; i <= m; i++) {
    if (s[i] == 0) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
