import Control.Monad
main :: IO ()
main = do
  n <- readLn
  qs <- replicateM n $ fmap (map read . words) getLine :: IO [[Int]]
  let ans = map solve qs
  seq ans $ mapM_ (\x -> putStrLn $ if x then "Yes" else "No") ans

solve :: [Int] -> Bool
solve as = isPossible as
  where
    isPossible as
      | a < b || b > d = False
      | b == d = a `mod` b <= c
      | otherwise = ow
      where
        (a:b:c:d:_) = as
        gcdbd = gcd b d
        ow = all (\x -> (x + if x <= c then d else 0) >= b) $ [ (a + x * gcdbd) `mod` b| x <- [0..(div b gcdbd)]]
