import Prelude main :: IO () main = do [x, y] <- map read . words <$> getLine n <- readLn as <- map read . words <$> getLine putStrLn $ convert $ solve x y n as convert :: Bool -> String convert True = "YES" convert False = "NO" solve :: Int -> Int -> Int -> [Int] -> Bool solve vx vy n as = let dv = vy - vx in all id $ map (\(a, d) -> dv * a <= d * vx) $ distances as where distances :: [Int] -> [(Int, Int)] distances (a:[]) = [(a, 536870911)] distances (a:b:as) = (a, (b - a)) : distances (b:as)