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
  rui = d-d/b*b
  if (rui==0 && diff <= c) || b <= c+1
    puts "Yes"
    next
  elsif  rui==0 && diff > c
    puts "No"
    next
  end
  gcd = rui.gcd(b)
  b -= diff
  c -= diff

  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

}