N = gets.to_i
h = []
h = gets.split.map(&:to_i)

d = []
d[0] = 0
low = 0
1.upto (N-1) do |i|
  d[i] = h[i] - h[i-1]
  # 2以上減少したらNo確定
  if d[i] <= -2
    puts "No"
    exit
  end
  # 1だけ減少した場合
  if d[i] == -1
    low += 1
    if low >= 2
      puts "No"
      exit
    end
  else
    low = 0
  end
end
puts "Yes"