Condition for Group given Semigroup with Idempotent Element

Theorem
Let $\struct {S, \circ}$ be a semigroup.

Let there exist an idempotent element $e$ of $S$ such that for all $a \in S$:
 * there exists at least one element $x$ of $S$ satisfying $x \circ a = e$
 * there exists at most one element $y$ of $S$ satisfying $a \circ y = e$.

Then $\struct {S, \circ}$ is a group.