He who walks with the wise grows wise, but a companion of fools suffers harm.
Misfortune pursues the sinner, but prosperity is the reward of the righteous.
Alternatively, the King James version:
He that walketh with wise men shall be wise: but a companion of fools shall be destroyed.
Evil pursueth sinners: but to the righteous good shall be repayed.