def ucrid(a, b)
  if a < b
    a, b = b, a
  end
  return b if a % b == 0
  ucrid(a - b, b)
end

t = gets.chomp.to_i
t.times do
  a, b, c, d = gets.chomp.split(' ').map(&:to_i)
  if a < b
    puts 'No'
    next
  end

  if b > d
    puts 'No'
    next
  end

  if c > b
    puts 'Yes'
    next
  end

  first_action = a % b
  unit = ucrid(b, d)
  if (c - first_action) / unit < (b - 1 - first_action) / unit
    puts 'No'
  else
    puts 'Yes'
  end

end
