I'm reading Fermat's Theorem (that $a^{p-1} \equiv 1 \pmod{p}$) proof (What is mathematics book) and they consider the multiples of a $m_1 = a, m_2 = 2a, m_3 = 3a, ..., m_{p-1} = (p-1)a$. They explain why no two of these numbers can be congruent modulo p. Also, I understand why these numbers aren't congruent to $0$ modulo p. Then they say that the numbers $m_1, m_2, ..., m_{p-1}$ must be respectively congruent to the numbers 1, 2, 3, ..., p-1.
I can't understand how they came to the last conclusion which is in bold. I will be grateful for any help you can provide.
Note that two numbers are not congruent to each other modulo $p$, and none of them is congruent to $0$. Furthermore, the remainders of $m_1, m_2, \cdots , m_{p-1}$ belong to the set $\{1,2,\cdots, p-1\}$. Since they are not equal to each other, it must be true that $$m_1 \times m_2 \times \cdots \times m_{p-1} \equiv 1\times 2 \times \cdots \times (p-1) \pmod{p}.$$
As an example, consider $p=5$ and $a=2$. Consequently, $$m_1 \equiv 2, m_2\equiv 4, m_3 \equiv 1, m_4\equiv3 \pmod{5},$$ and $$m_1 \times m_2 \times m_3 \times m_{4} \equiv 1\times 2 \times 3 \times 4 \pmod{5}.$$