t = gets.to_i

def f a,b,c,d
  h = {}
  
  while 1
    if a<b
      return "No"
    end
    a = a%b
    if a<=c
      a += d
    end
    if !h[a]
      h[a] = true
    else
      return "Yes"
    end
  end
  return ""
end

t.times{
  a,b,c,d = gets.split.map(&:to_i)
  
  puts f(a,b,c,d)
}
