N = gets.chomp.to_i
Hn = gets.chomp.split(' ').map(&:to_i)[0...N]

(N-1).downto(1) do |i|
  Hn[i-1] -= 1 if Hn[i-1] > Hn[i]
end

top = 0
is_ng = false
Hn.reduce do |prev, curr|
  break is_ng = true if curr < prev
  top = prev
  curr
end
 
puts is_ng ? 'No' : 'Yes'
