class Integer
  def mod_max(a, d)
    g = self.gcd(d)
    self - g + a % self
  end
end

T = gets.to_i

def f(a, b, c, d)
  return false if a < b
  return false if d < b
  return true if c >= b

  b.mod_max(a, d) <= c
end 

T.times do
  a, b, c, d = gets.split.map(&:to_i)

  if f(a, b, c, d)
    puts 'Yes'
  else
    puts 'No'
  end
end
