It is clear that there is a relation between the notion of unique factorization domain (a commutative domain in which every non-zero non-invertible element is a product of irreducible elements, and if a1a2 . . . an = a1a ′ 2 . . . a ′ m are any two such factorizations, then n = m and there exists a permutation σ such that ai and aσ(i) are associates for every i = 1, 2, . . . , n), the Krull-Schmidt Theorem (every module of finite length is a direct sum of indecomposable modules, and if A1⊕A2⊕· · ·⊕An = A1⊕A2⊕· · ·⊕Am are any two such decompositions, then n = m and there exists a permutation σ such that Ai ∼= Aσ(i) for every i = 1, 2, . . . , n), and the Jordan-Holder Theorem (every module A of finite length has a composition series, and if A = A0 ≥ A1 ≥ · · · ≥ An = 0 and A = A0 ≥ A1 ≥ · · · ≥ Am = 0 are any two composition series, then n = m and there exists a permutation σ such that Ai−1/Ai ∼= Aσ(i)−1/Aσ(i) for every i = 1, 2, . . . , n). The relation between these three contexts is that what we state is equivalent to saying that some commutative monoid is free in all these three cases. An integral domain R is a unique factorization domain if and only if the commutative monoid R∗/U(R) is free, where we have denoted by R∗ the multiplicative monoid R \ {0} and by U(R) the group of invertible elements of R. In this case, a free set of generators of R∗/U(R) is ∗Partially supported by Ministero dell’Universita e della Ricerca Scientifica e Tecnologica (Progetto di ricerca di rilevante interesse nazionale “Nuove prospettive nella teoria degli anelli, dei moduli e dei gruppi abeliani”), Italy. This paper was written when the authors were visiting the Centre de Recerca Matematica, Barcelona. They wish to thank the Centre for the hospitality provided.