n = gets.to_i
for i in 1..n
  ar = gets.chomp.split(" ").map(&:to_i)
  if ar[0] >= ar[1]
    if ar[1] > ar[3]
      puts "No"
    else
      if ar[1] <= ar[2]
        puts "Yes"
      elsif (ar[0] % ar[1]) >= ar[2]
        puts "No"
      elsif ar[3] % ar[1] < ar[1] - ar[2]
        puts "No"
      elsif ar[1] - (ar[3] % ar[1]) < ar[1] - ar[2]
        puts "No"
      else
        count = ar[0] % ar[1]
        inst = ar[3] % ar[1]
        inst2 = ar[2]
        for j in 1..ar[1] - 1
          count += inst
          count %= ar[1]
          if count > inst2
            puts "No"
            break
          end
          if j == ar[1] - 1
            puts "Yes"
          end
        end
      end
    end
  else
    puts "No"
  end
end