n = gets.to_i
h = gets.split.map &:to_i

def stairs(n,h)
  (n-1).downto(0) do |i|
    if i == 0
      puts "Yes"
      exit
    end
    if h[i-1] - h[i] > 1
      puts "No"
      exit
    elsif h[i-1] - h[i] == 1
      h[i-1] -= 1
    end
  end
end

puts stairs(n,h)
