Question about proof of 'There are infinitely many primes $p$ with $p \equiv 2(\text{mod3})$'

I have read other proof, but I am stuck on the proof in my algebra class. Hope someone could help me. Thanks a lot.

Prove by contradiction. Let $$\{ p_1,\dots p_n\}$$ be our finite primes with $$p_i \equiv 2 (\text{mod3})$$ $$\forall i$$.

Let $$m=1+p_1^{2}\dots p_n^{2}$$

Then $$m\equiv 2 (\text{mod3})$$.

By fundamental theorem of arithmetic $$m=q_1\dots q_t$$, where $$q_i$$ is prime $$\forall i$$

How can I prove that $$q_i=3$$ or $$q_i\equiv1 (\text{mod3})$$ $$\forall I$$ ?

Since if I prove it, then $$m=q_1\dots q_t\equiv 1 \;\text{or}\; 3$$ and we get the contradiction.

My professor have define $$q_i'=p_1^2\dots p_i\dots p_n^2$$, so that $$m=q_i'p_i+1$$. But I have no idea why we have to define this.

Since $$m \equiv 2\;(\text{mod}\;3)$$, we can't have any $$q_i=3$$ (else $$m$$ would be a multiple of $$3$$).
But if $$q_i \equiv 1\;(\text{mod}\;3)$$ for all $$i$$, then the product $$q_1\cdots q_t$$ would be congruent to $$1$$ mod $$3$$, contrary to $$m \equiv 2\;(\text{mod}\;3)$$.
It follows that $$q_k \equiv 2\;(\text{mod}\;3)$$ for some $$k$$.
But $$m$$ is not divisible by any of $$p_1,...,p_n$$, so $$q_k$$ is a new prime congruent to $$2$$ mod $$3$$.