n = gets.to_i
h = gets.split.map(&:to_i)
f = 1
max = 0
(h.length-1).times do |i|
  max = h[i] if max < h[i]
  if h[i]-h[i+1] >= 2 || max-h[i+1] >= 2 then
    print 'No'
    f = 0
    break
  end  
end
 
print 'Yes' if f == 1