Biconditional statements with Or

If I have a biconditional statement like this: Let p be an integer other than 0, -1, +1. Prove that p is prime if and only if for each a that exists in Z either (a, p) =1 or p|a.

I know that when you have a biconditional, you have to prove the statement both ways. However, when you solve it the other way, do you have to switch it to an "and," or do you have to do three proofs, one forward, and two backward (One for each case)? I have a homework problem where I have to prove this statement, and going forward is easy but to prove it the other way around, I feel like I need both of those statements to actually prove it.