Yes. King Solomon writes in Proverbs, 24:16, "A righteous person will fall seven times and pick himself up". Rabbi Yitzchak Hutner, one of the greatest Jewish thinkers from the previous generation, explains that this does not mean that they pick themselves up because they are righteous but, rather, that they become righteous because they stumbled and then overcame the mistakes that they made. In effect, King Solomon is teaching us that if we learn from our mistakes and become stronger and better people, our mistakes turn into wonderful vehicles to grow closer to God.