lines = []
while line = gets
    lines << line.chomp.split(' ').map(&:to_i)
end

N = lines[0][0]

ans = "Yes"
for i in 2..N do
  if lines[1][i-1] < lines[1][i-2] - 1 then
    ans = "No"
  end
end
  
print ans