Find all prime numbers $p$ for which there exists a unique $a \in\{1,2, \ldots, p\}$ such that $a^{3}-3 a+1$ is divisible by $p$.

Let's think step by step and output the final answer within \boxed{}.
user