n = gets.to_i
a = gets.split.map(&:to_i)

for i in 0..n-1
  if i == 0
    next
  end

  if i == 1
    unless a[i-1] - 1 <= a[i]
      puts 'No'
      exit
    end
    next
  end

  unless a[i-2] - 1 <= a[i] && a[i-1] - 1 <= a[i]
    puts 'No'
    exit
  end
end
puts 'Yes'