Variantly: He (Moses) said to them: "And we abode in the valley opposite Beth Peor." See the difference between you and me. How many prayers did I pray? Yet it was decreed upon me not to enter the land. But you angered Him for forty years, as it is written (Psalms 95:10) "Forty years I was angry with the generation. And, what is more, the greatest among you prostrated themselves to Peor, yet His right hand is stretched forward to accept penitents, so (Devarim 4:1) "now, O Israel, hearken to the statutes" — You are new; the past has been forgiven!
Moses Points to Beth Peor and Says Look at the Difference
Sifrei Devarim 30:2