N = gets.to_i
H = gets.chomp.split(" ").map(&:to_i)

ans, l, ll = ['Yes', 0, 0]
H.each{|h|
  (ans = 'No'; break) if l - h > 1
  (ans = 'No'; break) if ll - h > 0
  l -= 1 if l - h == 1
  ll = l
  l = h
}

puts ans
