T = gets.to_i

T.times do
  ans = "Yes"
  a, b, c, d = gets.split.map(&:to_i)
  if a < b or b > d
    ans = "No"
  else
    arr=[]
    while loop
      n = a/b
      nn = c - (a - b*n)
      plus = 0  
      plus = 1 if nn == 0
      m = (nn/b.to_f).ceil + plus
      a = a - b*n + b*m
      if arr.include?(a)
        ans = "Yes"
        break
      else
        arr << a
      end
      a -= b
      if a < 0
        ans = "No"
        break
      end
      if a <= c
        a += d 
      end
    end
  end
  puts ans
end