n = gets.to_i
arr = gets.to_s.split(' ')
arr = arr.map(&:to_i)

bool = 'Yes'

if arr.size == 2
  if arr[0] <= arr[1]
    puts 'Yes'
  else
    puts 'No'
  end
else
  (2...n).each do |i|
    bool = 'No' if arr[i - 2] - 1 > arr[i - 1]
    bool = 'No' if arr[i - 1] - 1 > arr[i]
    if arr[i - 2] - 1 == arr[i - 1] && arr[i - 1] - 1 == arr[i]
      bool = 'No' if arr[i - 1] > arr[i]
    end
  end
  puts bool
end
