i = gets.to_i
t = gets.split(" ").map(&:to_i)
t << -1
(0..i-1).each do |n|
  if n == i-1
      puts "Yes"
      break
  end
  if t[n]>t[n+1]
      t[n] = t[n]-1
      if t[n]>t[n+1]
          puts "No"
          break
      end
  end
end