solve [] = True
solve as | length as < 3 = True
         | (x <= y && y <= z) = solve (y:z:w)
         | (x <= (y-1) && (y-1) <= z) = solve ((y-1):z:w)
         | otherwise = False
            where
                x = as!!0
                y = as!!1
                z = as!!2
                w = drop 3 as

main = do
    n <- readLn :: IO Int
    hn <- map read . words <$> getLine :: IO [Int]
    if solve hn
        then putStrLn $ "Yes"
        else putStrLn $ "No"
