n = gets.to_i
hs = gets.split.map(&:to_i)
flag = n.times.map { false }

res = true
(n - 1).times do |i|
  if hs[i] > hs[i + 1]
    if flag[i] == true
      res = false
      break
    else
      hs[i] -= 1
      flag[i] = true
    end
  elsif hs[i] < hs[i + 1]
    hs[i + 1] -= 1
    flag[i + 1] = true
  end

  if i != 0 && hs[i - 1] > hs[i]
    res = false
    break
  end 
end

if res == true
  puts 'Yes'
else
  puts 'No'
end