def check(L1, R1, L2, R2): for i in range(M): if L1 <= i <= R1 and L2 <= i <= R2: return False return True N, M = map(int, input().split()) pre0, pre1 = 1, 1 preL, preR = map(int, input().split()) for i in range(N - 1): L, R = map(int, input().split()) dp0, dp1 = 0, 0 if pre0: if check(L, R, preL, preR): dp0 = 1 if check(M + 1 - R, M + 1 - L, preL, preR): dp1 = 1 if pre1: if check(L, R, M + 1 - preR, M + 1 - preL): dp0 = 1 if check(M + 1 - R, M + 1 - L, M + 1 - preR, M + 1 - preL): dp1 = 1 pre0, pre1 = dp0, dp1 preL, preR = L, R print("YES") if pre0 or pre1 else print("NO")