n = gets.to_i
h = gets.split.map(&:to_i)
if n == 1
  puts "Yes"
elsif n == 2
  puts (h[1] - h[0] >= -1) ? "Yes" : "No"
else
  possible = true
  prev_diff = 1000000000
  for i in 1...n do
    if h[i] - h[i - 1] == -1
      if prev_diff < 1
        possible = false
        break
      else
        prev_diff = 0
      end
    elsif h[i] - h[i - 1] < -1
      possible = false
      break
    else
      prev_diff = h[i] - h[i - 1]
    end
  end
  puts possible ? "Yes" : "No"
end
