Hello!!!

Let $b_1< b_2< \dots< b_{\phi(m)}$ be the integers between $1$ and $m$ that are relatively prime to $m$ (including 1), and let $B=b_1 b_2 b_3 \cdots b_{\phi(m)}$ be their product.

I want to show that either $B \equiv 1 \pmod{m}$ or $B \equiv -1 \pmod{m}$ .

Also I want to find a pattern for when $B$ is equal to $+1 \pmod{m}$ and when it is equal to $-1 \pmod{m}$.

I have thought the following:

We have that $(b_i, m)=1, \forall i=1, \dots, \phi(m)$.

So there are $x_i, y_i \in \mathbb{Z}$ such that $x_i b_i+ y_i m=1$.

Then we have that $x_1 \cdot x_2 \cdots x_{\phi(m)} \cdot b_1 \cdot b_2 \cdots b_{\phi(m)} \equiv 1 \pmod{m} \Rightarrow x_1 \cdot x_2 \cdots x_{\phi(m)} \cdot B \equiv 1 \pmod{m}$.

So we need to show that $x_1 \cdot x_2 \cdots x_{\phi(m)} \equiv \pm 1 \pmod{m}$. How can we show this?