n = gets.chomp.to_i
hlist = gets.chomp.split.collect{ |item| item.to_i}
list = hlist.reverse
result = "Yes"
prev = list[0]
list.each do |hi|
  if hi <= prev
    prev = hi
  elsif (hi-1) <= prev
    prev = hi-1
  else
    result = "No"
  end
end
puts result