C, 63 bytes
i,n;main(p){for(scanf("%d",&i),n=i;--i;p*=i*i);putchar(48+p%n);}
Prints !1
(a falsey value, by Peter Taylor's definition)0
if (n-1)!^2 == 0 (mod n)
, and 1
otherwise.
EDIT: After some discussion in chat, puts("!1"+p%n)
seems to be considered a bit cheaty, so I've replaced it. The result is one byte longer.