lines = STDIN.readlines
n = lines[0].chomp.to_i
h = lines[1].split(" ").map(&:to_i).reverse

(n-1).times do |i|
    if h[i + 1] - h[i] > 1
      puts "No"
      exit
    end

    if h[i+1] - h[i] == 1
      h[i + 1] -= 1
      next
    end
end

puts "Yes"
