n = gets.chomp.to_i
h = gets.chomp.split(" ").map(&:to_i)

chk = 0

if n == 1
  puts "Yes"
else
  (n-1).times do |i|
     if h[i] <= h[i+1]
     elsif (h[i] == h[i+1] + 1) and (h[i-1] <= (h[i]-1))
       h[i] -= 1
     else
       chk += 1
       break
     end
  end
  puts "Yes" if chk == 0
  puts "No" if chk == 1
end
