Corollary of Krull-Remak-Schmidt theorem for cancellation of factors in direct product

Statement
If $$G$$, $$H$$, and $$K$$ are groups of finite composition length such that the external direct products $$G \times H$$ and $$G \times K$$ are isomorphic, i.e., $$G \times H \cong G \times K$$, then $$H \cong K$$.

Related facts

 * Krull-Remak-Schmidt theorem
 * Corollary of Krull-Remak-Schmidt theorem for cancellation of powers
 * Direct product is cancellative for finite groups

Facts used

 * 1) uses::Krull-Remak-Schmidt theorem