t = gets.to_i
patterns = []

0.upto(t-1) do |i|
  patterns.push(gets.split.map(&:to_i))
end

patterns.each do |pattern|
  a = pattern[0]
  b = pattern[1]
  c = pattern[2]
  d = pattern[3]
  stock = a
  timer = 0

  stock -= b
  if stock < 0
    puts 'No'
    next
  end
  stock += d if stock <= c

  if a == 1000000000000000000
    if a == c + d
      puts 'Yes'
      next
    else
      puts 'No'
      next
    end
  end

  loop do
    stock -= b
    if stock < 0
      puts 'No'
      break
    end

    stock += d if stock <= c
    if a == stock || timer > 1000
      puts 'Yes'
      break
    else
      timer += 1
    end
  end
end