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

h_diff = []
h.each_with_index do |v,i|
  next if i == 0
  h_diff << h[i] - h[i-1]
end

h_diff.each_with_index do |v,i|
  next if v >= 0
  if v == -1
    h_diff[i] = 0
    h_diff[i+1] -= 1
    next
  end
  puts 'No'
  exit
end

puts 'Yes'

