T = gets.to_i


for i in 0..T - 1 do
  num = gets.chomp.split(" ").map(&:to_i);

  val = (num[0] - num[1]) % num[1]
  rem = num[3] - num[1] 
  # print(val.to_s + ":" + num[1].to_s + "\n")  
  flg = true

  if rem <= 0
    if val < num[1] && val > num[2]
      flg =  false
    end
  else
    while val < num[1]
      if val < num[1] && val > num[2]
        flg = false
      end
      val = val + rem
    end
  end

  if flg
      print("Yes\n")
  else
    print("No\n")
  end

end