let rec gcd n m =
  if m = 0 then n
  else gcd m (n mod m)

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

