local n = io.read("*n")
local h = {}
for i = 1, n do
  h[i] = io.read("*n")
end
h[1] = h[1] - 1
local ret = true
for i = 2, n do
  if h[i] < h[i - 1] then
    ret = false
    break
  elseif h[i - 1] < h[i] then
    h[i] = h[i] - 1
  end
end
print(ret and "Yes" or "No")
