Compact Subspace of Linearly Ordered Space/Reverse Implication

Theorem
Let $\left({X, \preceq, \tau}\right)$ be a linearly ordered space.

Let $Y \subseteq X$ be a non-empty subset of $X$.

For every non-empty $S \subset Y$, let $S$ have a supremum and an infimum in $X$, and $\sup S, \inf S \in Y$.

Then $Y$ is a compact subspace of $\left({X, \tau}\right)$.