def read_data(): N, M = map(int, input().split()) LR = [] for n in range(N): L, R = map(int, input().split()) LR.append((L, R)) return N, M, LR def solve(N, M, LR): imos = [0] * (M + 1) for L, R in LR: imos[L] += 1 imos[R + 1] -= 1 imos[M - R - 1] += 1 imos[M - L] -= 1 cum = 0 for v in imos: cum += v if cum > 2: return False return True N, M, LR = read_data() if solve(N, M, LR): print('YES') else: print('NO')