def main
  gets
  values = gets.chomp.split(' ').map(&:to_i)
  pre = values.pop
  values.reverse.each do |v|
    if v > pre + 1
      puts 'No'
      return
    elsif v > pre
      pre = v - 1
    else
      pre = v
    end
  end
  puts 'Yes'
end

main if $0 == __FILE__