def s()
  gets().chomp
end
def i()
  gets.to_i
end
def li()
  gets.split.map(&:to_i)
end
def ili()
  n = gets.to_i
  as = gets.split.map(&:to_i)
  [n, as]
end

t = i()
qs = []
t.times{
  qs << li()
}

qs.each{|q|
  a, b, c, d = q
  diff = a-a/b*b
  if a-b < 0 || (diff < b && diff > c) || (b>d)
    puts "No"
    next
  end

  if b==d && diff <= c
    puts "Yes"
    next
  elsif  b==d && diff > c
    puts "No"
    next
  end
  rui = d-b
  b -= diff
  c -= diff
  gcd = rui.gcd(b)

  tyukan1 = (c.to_f/gcd).ceil*gcd
  tyukan2 = ((c.to_f/gcd).ceil+1)*gcd


  if b > tyukan1 && tyukan1 > c || b > tyukan2 && tyukan2 > c
    puts "No"
  else
    puts "Yes"
  end

}