def gcd(a,b):
  if b==0:
    return a
  else:
    return gcd(b,a%b)

def solve(a,b,c,d):
  if a < b or d < b:
    return True

  mi=a-b
  ma=a-c
  cnt=gcd(b,d)
  for i in range(mi+1,ma):
    if i%cnt==0:
      return True
  return False

T=int(input())
for i in range(T):
  A,B,C,D=map(int,input().split())
  if solve(A,B,C,D):
    print("No")
  else:
    print("Yes")
    