import Control.Monad
import Text.Printf
import Control.Applicative

main :: IO()
main = do
  testCase <- readLn
  forM_ [1..testCase] $ \i -> do
    a <- map read . words <$> getLine
    printf "%s\n" $ slv (a!!0) (a!!1) (a!!2) (a!!3)

slv :: Integer -> Integer -> Integer -> Integer -> String
slv a b c d | b > d = "No"
            | a - b < 0 = "No"
            | b - c > 1 && gcdbd == 1 && b /= 1 = "No"
            | a `mod` b > c = "No" 
            | moddb /= 0 && val2 - val1 >= 0 = "No"
            | c - b >= 0 = "Yes"
            | otherwise = "Yes"
  where gcdbd = gcd b d
        modab = a `mod` b
        moddb = d `mod` b
        (v1, v2) = (c + 1 - modab) `divMod` moddb
        val2 = (b - 1 - modab) `div` moddb
        val1 | v2 /= 0 = v1 + 1
             | otherwise = v1
