import numpy as np N, M = map(int, input().split()) lst = [0] * (M + 1) for i in range(N): l, r = map(int, input().split()) lst[l] += 1 lst[r + 1] -= 1 Acc = np.cumsum(lst[:-1]) flag = np.any(Acc + Acc[::-1] > 2) print('NO' if flag else 'YES')