gets
H = gets.split.map(&:to_i)

pv = 0
ok = true
H.each.with_index do |h, i|
  if i != 0 && (i+1) != H.length && (h - pv) > 1
    ok = false
  end
  pv = h
end

if ok
  puts "Yes"
else
  puts "No"
end
