T = gets.to_i
A = Array.new(T)
B = Array.new(T)
C = Array.new(T)
D = Array.new(T)
T.times do |i|
  A[i], B[i], C[i], D[i] = gets.split.map(&:to_i)
end

T.times do |i|
  if A[i] >= B[i]
    if A[i] % B[i] > C[i]
      puts "No"
      next
    elsif A[i] % B[i] + D[i] == A[i]
      puts "Yes"
      next
    end
    if B[i] <= C[i] && B[i] <= D[i]
      puts "Yes"
      next
    else
      a = []
      a << A[i]
      while true
        A[i] -= B[i]
        mod = A[i] % B[i]
        if A[i] < 0
          puts "No"
          break
        elsif mod <= C[i]
          A[i] = mod + D[i]
        else
          A[i] = mod
        end
        if a.include?(A[i])
          puts "Yes"
          break
        else
          a << A[i]
        end
      end
    end
    # a = []
    # a << A[i]
    # while true
    #   A[i] -= B[i]
    #   mod = A[i] % B[i]
    #   if A[i] < 0
    #     puts "No"
    #     break
    #   elsif mod <= C[i]
    #     A[i] = mod + D[i]
    #   else
    #     A[i] = mod
    #   end
    #   if a.include?(A[i])
    #     puts "Yes"
    #     break
    #   else
    #     a << A[i]
    #   end
    # end
  else
    puts "No"
  end
end
