import Control.Monad
main :: IO ()
main = do
  n <- readLn
  qs <- replicateM n $ fmap (map read . words) getLine :: IO [[Int]]
  mapM_ solve qs

solve :: [Int] -> IO ()
solve as = putStrLn $ if isPossible as then "Yes" else "No"
  where
    isPossible as
      | a < b || b > d = False
      | otherwise = innerSolve b' c' d'
      where
        (a:b:c:d:_) = as
        skys = gcd' as
        b' = div b skys
        c' = div c skys
        d' = div d skys
        gcdacd = gcd' [a, c, d]
        innerSolve b c d
          | b == d = a `mod` b <= c
          | otherwise = all (\x -> (x + if x <= c then d else 0) >= b) [x | x <- [0..(b - 1)], x `mod` gcdacd == 0]

gcd' :: (Integral a) => [a] -> a
gcd' [] = 1
gcd' [x] = x
gcd' (x:xs) = gcd x (gcd' xs)

innerSolve' a b c d
  | b == d = a `mod` b <= c
  | otherwise = all (\x -> (x + if x <= c then d else 0) >= b) [x | x <- [0..(b - 1)], x `mod` gcdabd == 0]
  where
    gcdabd = gcd' [a,b,d]
