#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n, m;
  int aa[200];
  while (cin >> n >> m) {
    memset(aa, 0, sizeof(aa));
    int flag = 0;
    for (int i = 0; i < n; i++) {
      int a, b;
      cin >> a >> b;
      for (int j = a; j < b; j++) {
        aa[j] += 1;
      }
    }
    for (int i = 0; i < m; i++)
      if (aa[i] == 0) {
        flag = 1;
        break;
      }
    if (flag == 1)
      printf("NO\n");
    else
      printf("YES\n");
  }
  return 0;
}
