n=gets.to_i
h=gets.split.map(&:to_i)
p="yes"
if n==1 then
  p="Yes"
elsif n>1&& (h[1]-h[0]) < -1 then
  p="No"
else
(1..n-1).each do |i|
  if h[i]-h[i-1] < 0 then
    p="No"
    break
  else
  end
  end
end
  print p
