from fractions import gcd

def solve(A,B,C,D):
  if D<B:
    return "No"
  if A<B:
    return "No"
  if C>=B-1:
    return "Yes"
  g = gcd(B,D)
  if A-(A-C-1)/g*g<B:
    return "No"
  return "Yes"

T = input()
for _ in range(T):
  A,B,C,D = map(int, raw_input().split())
  print solve(A,B,C,D)
