#E A, B, C = gets.chomp.split.map(&:to_i)
N = gets.chomp.to_i
H = gets.chomp.split.map(&:to_i)

def can_decrease?
1.upto(N - 1).each do |i|
  if H[i] < H[i-1]
    return false
  elsif H[i] == H[i-1]
    # continue
  else  # H[i] > H[i-1]
    H[i] -= 1
    # continue
  end
end
  true
end

r = can_decrease?

# p H
if r
  print "Yes\n"
else
  print "No\n"
end