Scanf.scanf "%d" (fun t ->
    let rec gcd a b = if b = 0 then a else gcd b (a mod b) in
    for i = 1 to t do
        Scanf.scanf " %d %d %d %d" (fun a b c d ->
            print_endline @@
                if d < b then "No" else
                if a < b then "No" else
                if c + gcd b d >= b + (a mod gcd b d) then "Yes" else "No"
        )
    done
)