n = gets.chomp.to_i
input = gets.chomp.split(' ').map(&:to_i)
# p input
ans = ''
(0..n-1).to_a.each_cons(2) do |a, b|
  if input[b] - input[a] == -1
    input[a] -= 1
  end
end
# puts ans
array = Array.new
(0..n-1).to_a.each_cons(2) do |a, b|
  array << input[b] - input[a]
end
if array.all? { |n| n >= 0 }
  puts 'Yes'
else
  puts 'No'
end
