Ecclesiastes 7:14-17 King James Version (KJV)

14. In the day of prosperity be joyful, but in the day of adversity consider: God also hath set the one over against the other, to the end that man should find nothing after him.

15. All things have I seen in the days of my vanity: there is a just man that perisheth in his righteousness, and there is a wicked man that prolongeth his life in his wickedness.

16. Be not righteous over much; neither make thyself over wise: why shouldest thou destroy thyself?

17. Be not over much wicked, neither be thou foolish: why shouldest thou die before thy time?

Ecclesiastes 7