def calc_trigger(current, limit, dec)
  div = (current - limit) / dec
  div += 1 if (current - limit) % dec != 0
  return current - div * dec
end

def calc_over(current, limit, inc)
  div = (limit - current + 1) / inc
  div += 1 if (current - limit + 1) % inc != 0
  return current + div * inc
end

t = gets.to_i
t.times{|cn|
  a, b, c, d = gets.split.map(&:to_i)
  if b > d || a < b 
    puts "No"
    next
  end

  if c > b
    puts "Yes"
    next
  end
  
  inc = d - b
  lesses = []
  correct = false
  current = a
  while current >= b
    less = calc_trigger(current, c, b)
    if less < 0
      correct = false
      break
    end

    if lesses.include?(less)
      correct = true
      break
    end
    lesses << less
    if inc == 0
      correct = less <= c
      break
    end
    current = calc_over(less, c, inc)
  end

  puts "#{correct ? 'Yes' : 'No'}"
}