t = gets.to_i

t.times do |i|
  a, b, c, d = gets.split.map{|s|s.to_i}
  zaiko = []

  if a < b
    puts "No"
    next
  end

  loop do
    if zaiko.include?(a)
      puts "Yes"
      break
    else
      zaiko << a #(a = a % b)
      a = a - b +  (a < b ? d : 0)
      a = a % b
      if a < b && a > c && b <= d
        puts "No"
        break
      elsif b > d
        puts "No"
        break
      end
    end
  end
end