N = gets.to_i
H = gets.split.map(&:to_i)

ret = 'Yes'
heights = [0, 0, 0]

N.times do |i|
  if i == N - 1
    if heights[0] <= H[i]
      break
    else
      ret = 'No'
      break
    end
  end
  
  heights[1] = H[i]
  heights[2] = H[i + 1]
  
  if heights[0] <= heights[1] && heights[1] <= heights[2]
    if heights[0] + 1 == heights[1]
      heights[0] = heights[1] - 1
    else
      heights[0] = heights[1]
    end
    next
  elsif heights[0] <= heights[1] - 1 && heights[1] - 1 <= heights[2]
    heights[0] = heights[1] - 1
    next
  else
    ret = 'No'
    break
  end
end

puts ret