local function getgcd(x, y)
  while(0 < x and 0 < y) do
    if(x < y) then y = y % x else x = x % y end
  end
  return math.max(x, y)
end

local t = io.read("*n")

for i = 1, t do
  local a, b, c, d = io.read("*n", "*n", "*n", "*n")
  if(a < b) then print("No")
  elseif(d < b) then print("No")
  elseif(b <= c) then print("Yes")
  elseif(d % b == 0) then
    if(a % b <= c) then print("Yes") else print("No") end
  else
    local gcd = getgcd(a, getgcd(b, d))
    if(c // gcd + 1 == b // gcd) then print("Yes") else print("No") end
  end
end
