n = gets.to_i
h = gets.split.map(&:to_i)
if n == 1
  puts "Yes"
  exit
end
(1..n-1).each do |i|
  if h[i-1]-1 > h[i]
    puts "No"
    exit
  elsif  h[i-1]-1 == h[i]
    h[i] += 1
  end
end
puts "Yes"