n = gets.to_i

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

last = hs[0]
no = false  # f**k ruby 2.3.3
for i in 1...n do
  if last < hs[i] then
    last = hs[i]
  elsif hs[i] == last || hs[i] == last - 1 then
  else
    no = true  # f**k ruby 2.3.3
    break  # f**k ruby 2.3.3
  end
end
puts no ? 'No' : 'Yes'