Am I a Pillai prime? A Pillai prime is a prime number \$p\$ for which there exists some positive \$m\$ such that \$(m! + 1) \equiv 0 \:(\text{mod } p)\$ and \$p \not\equiv  1\:(\text{mod }m)\$. 

In other words, an integer \$p\$ is a Pillai prime if it is a prime number, if there exists another positive integer \$m\$ such that the factorial of \$m\$, plus \$1\$ is divisible by \$p\$ and if \$p - 1\$ isn't divisible by \$m\$.



Given a positive integer as input, decide whether it is a Pillai prime. The sequence of Pillai primes is OEIS A063980.

For example, \$23\$ is a Pillai prime because:


It is a prime number, having only 2 factors.
\$m = 14\$ and \$m = 18\$ satisfy the above conditions: \$23 \mid (14! + 1)\$ and \$14\$ does not divide \$22\$; \$23 \mid (18! + 1)\$ and \$18\$ does not divide \$22\$ either.


Test cases

Truthy:


23
59
83
109
139
593


Falsy:


5
7
8
73
89
263
437


For the truthy cases, the respective m's are [(23, [14, 18]), (59, [15, 40, 43]), (83, [13, 36, 69]), (109, [86]), (139, [16]), (593, [274])].



You can either follow the standard decision-problem output format (that is, truthy / falsy values) or have a consistent value for Pillai primes and a non-consistent value otherwise or vice-versa.

You can compete in any programming language and can take input and provide output through any standard method, while taking note that these loopholes are forbidden by default. This is code-golf, so the shortest submission (in bytes) for every language wins.
Python 2, 115 111 110 109 bytes

-6 bytes thanks to Mr. Xcoder


lambda n:n&gt;2and cmp(*map(all,zip(*[[n%x==1or~f(x)%n,n%x]for x in range(2,n)])))&lt;0
f=lambda x:0**x or x*f(x-1)


Try it online!

The functions consist of two parts ~-n%x&lt;1or~f(x)%n&gt;0 that verifies if n don't satisfies the "Pillai conditions", and n%x&gt;0 for the prime validation.
After that all is applied to both items, the first item will contain False/0 if there is a valid "Pillai number", and the second will contain True/1 if n is prime.
These are passed to cmp that will return -1 in this cenario (is a valid Pillai prime). The other combinations [[0, 0], [1, 0], [1, 1]] will return 0 or 1