local n = io.read("*n")
local c = 0
local f = true
for i = 1, n do
  local a = io.read("*n")
  if a < c then f = false
  else
    if c < a then
      a = a - 1
      c = a
    end
  end
end
print(f and "Yes" or "No")
