N, M = map(int, input().split()) X = [0] * (M + 1) for _ in range(N): l, r = map(int, input().split()) X[l] += 1 X[r + 1] -= 1 X[M - r - 1] += 1 X[M - l] -= 1 Y = [0] * M for i in range(M): Y[i] = X[i] + Y[i - 1] if Y[i] > 2: print("NO") exit() print("YES")