import Control.Applicative ((<$>)) import Data.ByteString.Char8 (ByteString) import qualified Data.ByteString.Char8 as B import Data.List import Data.Char (isSpace) main :: IO () main = do [x, y] <- getl (readil B.readInt) B.getLine solve x y <$> getl (readil B.readInt) >>= putStrLn solve :: Int -> Int -> [Int] -> String solve x y as | all f $ zip as (tail as) = "YES" | otherwise = "NO" where f (ai, aj) = ai * y <= aj * x getl :: (ByteString -> a) -> IO a getl f = f <$> B.getLine readil :: Integral a => (ByteString -> Maybe (a, ByteString)) -> ByteString -> [a] readil f = unfoldr g where g s = do (n, s') <- f s return (n, B.dropWhile isSpace s')