Prime number validator.