Why is it, asked the Chasam Sofer R' Moshe Sofer, that when Rivkah passed the beis midrash, Yaakov attempted to escape from her womb? After all, Chazal teach us that during the time a child is in its mother's womb, an angel comes and teaches it the entire Torah. Did Yaakov think that he would actually be able to lean more in the beis midrash than he would from the angel?
The answer, said the Chasam Sofer, is that though Yaakov was learning the entire Torah from the mouth of an angel, he was forced to do so in the presence of Esav. Yaakov preferred to learn Torah in a beis midrash, free from the company of his wicked brother, than to be taught the entire Torah directly from the mouth of a holy angel !
From the words of the Chasam Sofer we are able to learn, remarked the Chofetz Chaim, just how important it is to stay far away from people who may have a negative influence on us.