f::[Int]->String
f []="Yes"
f (x:[])="Yes"
f (x:y:es)
     |x<y=f ((y-1):es)
     |x==y=f (y:es) 
     |otherwise="No"

main =do
      n<-getLine
      e<-getLine
      let xs=map read (words e)::[Int]
      putStrLn $ f xs