T=int(input())

for cnt in range(T):
  A,B,C,D=map(int,input().split())
  if(B > D or A < B):
    print("No")
    continue
  if(B <= C):
    print("Yes")
    continue

  A = A % B + B
  Zaiko = A
  lista = []
  i = 0
  while(i < 100):
    Zaiko = Zaiko - B
    #print(Zaiko)
    if(Zaiko < 0):
      print("No")
      break
    if(Zaiko <= C):
      Zaiko += D
      Zaiko = Zaiko % B + B
    if(Zaiko in lista ):
      print("Yes")
      break
    lista.append(Zaiko)
    i += 1
    if(i == 100):
      if(C >= B - D):
        print("Yes")
      else:
        print("No")
  #print(A,B,C,D)
