Wilson’s theoremWilson’s theorem states that(p-1)!≡-1(modp)iff p is prime (note that it must be positive).