Example 2 Find a set $S$ composed of positive integers with at least two elements, such that the sum of all elements in $S$ equals the product of all elements in $S$.
(2006, Tsinghua University Independent Admission Examination)
If $S$ contains only two elements, let them be $a, b$, then
$$
\begin{array}{l}
a b=a+b \\
\Rightarrow(a-1)(b-1)=1 .
\end{array}
$$

Also, $a-1 \geqslant 0, b-1 \geqslant 0$, so
$$
\begin{array}{l}
a-1=b-1=1 \\
\Rightarrow a=b=2 .
\end{array}
$$

Contradiction.
If $S$ contains three elements, by the conclusion of Example 1, we know $S=\{1,2,3\}$.
If $S$ contains more than four elements, let them be
$$
a_{1}n a_{n}>a_{1}+a_{2}+\cdots+a_{n} \text {. }
$$

Contradiction.
In summary, $S=\{1,2,3\}$.
2 Congruence properties