n = gets.to_i
h = gets.split.map(&:to_i)
h[0] -= 1
if h[0] > h[1]
  puts "No"
  exit
else
  h[1] -= 1 if h[0] < h[1]
end
2.upto(n-2) do |i|
  puts "#{h[i-1]} #{h[i]} #{h[i+1]}"
  if (h[i] > h[i+1]) && (h[i-1] >= h[i])
    puts "No"
    exit
  else
    h[i] -= 1
  end
end

if h[n-2] > h[n-1]
  puts "No"
else
  puts "Yes"
end