import Control.Applicative import Control.Monad main :: IO () main = do [_, m] <- f solve <$> replicateM m f >>= putStrLn where f = map read <$> words <$> getLine solve :: [[Int]] -> String solve = maybe "No" (const "Yes") . foldl f (Just (0, 0)) where f tp [ti, pi] = do (tn, pn) <- tp guard $ (ti - tn) >= abs (pi - pn) return (ti, pi)