n = gets.to_i

line = gets.split(" ").map(&:to_i)

ctn = 0
for i in 0..n-2
    
   if line[i+1] - line[i] >= 0
	#puts "yes"
    a = 0
  
	elsif line[i+1] - line[i] <= -1
	line[i] = line[i] - 1

   end
end

#p line

for i in 0..i
  if line[i+1] - line[i] < 0
    a = 1
  	ctn += a
  end
end
 
if ctn > 0
  puts "No"
else 
  puts "Yes"
end