require 'pp'
T = gets.to_i
T.times do
  a, b, c, d = gets.split(' ').map(&:to_i)
  knowns = {} 
  knowns[a] = true

  cur = a
  if a - b > c
    cur = a % b
    while cur <= c
      cur += b
    end
    if cur <= c
      cur += d
    end
  end

  knowns[cur] = true
  while true
    day = cur - b
    # puts
    # puts "started a new day: #{cur}"
    # puts "reduced to: #{day}"
    if day < 0
      puts 'No'
      break
    end
    cur = day
    cur += d if day <= c
    # puts "end of a day: #{cur}"
    if knowns[cur]
      puts 'Yes'
      break
    end
    knowns[cur] = true
  end
end
