N = gets.to_i
if N == 1
    print 'Yes'
else
  h = gets.split(" ").map(&:to_i)
  ans = true
  (N-1).downto(1) do |i|
      if h[i-1] - h[i] > 1
        ans = false
        break
      elsif h[i-1] - h[i] == 1
        h[i-1] -= 1
      end
  end
puts 'Yes' if ans == true
puts 'No' if ans == false
end

