n = gets.to_i
h = gets.split.map &:to_i
c = 0
if n < 2
  c = 0
else
  n.times do |i|
    if i == 0
      if h[i] > h[i+1]
        h[i] -= 1
      end
    elsif i == n - 1
      if h[i] < h[i-1]
        c = 1
        break
      end
    else
      if h[i] > h[i+1]
        h[i] -= 1
      end
      if h[i] < h[i-1]
        c = 1
        break
      end
    end
  end
end
if c == 0
  puts "Yes"
elsif c == 1
  puts "No"
end