import Control.Monad
import Data.Maybe
import qualified Data.Set as S

main :: IO ()
main = do
    n <- read <$> getLine :: IO Int
    qs <- replicateM n (map read . words <$> getLine) :: IO [[Int]]
    -- mapM_ query' qs
    mapM_ (putStrLn . (\f->if f then "Yes" else "No") . (\[a,b,c,d] -> let
        sa = mod (mod a b + d) b - mod a b
        in f a b c d
        )) qs

query' [a,b,c,d] = do
    print (a,b,c,d)
    print $ mod a b
    print $ mod (mod a b + d) b
    print $ mod (mod (mod a b + d) b + d) b
    print $ mod (mod (mod (mod a b + d) b + d) b + d) b
    print $ mod (mod (mod (mod (mod a b + d) b + d) b + d) b + d) b

f a b c d
    | a - b < 0  = False
    | otherwise  = f' a b c d S.empty

f' a b c d already
    | c < a' && a' < b     = False
    | a `S.member` already = True
    | isNothing b'         = False
    | otherwise            = f' (fromJust b') b c d already'
    where
    a'       = a `mod` b
    b'       = if a' + d >= b then Just $ a' + d 
                              else Nothing
    already' = a `S.insert` already