t = gets.chomp.to_i
list = t.times.map { gets.chomp.split(' ').map(&:to_i) }
list.each do |line|
  a, b, c, d = line

  if (a < b) || (a % b > c)
    puts 'No'
    next
  end

  x = d - b
  if x == 0
    puts 'Yes'
    next
  elsif  x < 0
    puts 'No'
    next
  end

  i = a % b
  cap = [i]
  loop do
    # cを初めて超える最小値
    w = (c - i) % x
    y = c - w + x
    if y < b
      puts 'No'
      break
    end
    i = (y % b) % x
    if cap.include?(i) || i == 0
      puts 'Yes'
      break
    end
    cap << i
  end
end
