import Control.Monad import Data.Maybe import qualified Data.ByteString.Char8 as BS import Control.Monad.ST import Data.Ix import Data.Array (Array) import Data.Array.IArray import Data.Array.IO import Data.Array.MArray import Data.Array.ST import Data.Array.Unboxed (UArray) import Data.Char import Data.List as L import Data.Foldable import Control.Exception import Data.Array.Base (STUArray(STUArray), UArray (UArray)) import Data.ByteString.Char8 (ByteString) import Data.Array.IO.Internals (IOUArray(IOUArray)) import Data.Ord (comparing, Down (Down)) tuplify2 :: [b] -> (b, b) tuplify2 (x:y:_) = (x,y) tuplify2 _ = undefined --Input functions with ByteString readInt :: ByteString -> Int readInt = fst . fromJust . BS.readInt readIntTuple :: ByteString -> (Int, Int) readIntTuple = tuplify2 . map readInt . BS.words readIntList :: ByteString -> [Int] readIntList = map readInt . BS.words getInt :: IO Int getInt = readInt <$> BS.getLine getIntList :: IO [Int] getIntList = readIntList <$> BS.getLine getIntListX :: IO [Int] getIntListX = readIntList <$> BS.getContents getIntNList :: Integral a => a -> IO [[Int]] getIntNList n = map readIntList <$> replicateM (fromIntegral n) BS.getLine getIntMatrix :: IO [[Int]] getIntMatrix = map readIntList . BS.lines <$> BS.getContents getIntTuple :: IO (Int, Int) getIntTuple = readIntTuple <$> BS.getLine getIntNTuples :: Integral a => a -> IO [(Int, Int)] getIntNTuples n = map readIntTuple <$> replicateM (fromIntegral n) BS.getLine getIntTuples :: IO [(Int, Int)] getIntTuples = map readIntTuple . BS.lines <$> BS.getContents putYesNo :: Bool -> IO () putYesNo bl = putStrLn $ if bl then "Yes" else "No" putInts :: [Int] -> IO () putInts x = putStrLn $ unwords $ map show x nubOrd :: Eq a => Ord a => [a] -> [a] nubOrd = map head.group.sort canJump :: Int -> Int -> Int -> Bool canJump j now next = now + j >= next f :: Int -> Int -> [Int] -> [Bool] f j b hs | null hs = [] | otherwise = canJump j b h : f j h (tail hs) where h = head hs main :: IO () main = do [n, s, b] <- getIntList hs <- getIntList let ans = all (== True) $ f (s * b) (head hs) (tail hs) putYesNo ans