n = readline.to_i
h = readline.split.map!(&:to_i)
flg = true
(1..n-1).each do |i|
  if (h[i-1] - h[i]).abs >= 2  then
    flg = false
  end
end
if flg === false then
  print('No')
else
  print('Yes')
end
