import math
n=int(input())
for _ in range(n):
    a,b,c,d=map(int,input().split())
    if d<b:
        print("No")
        continue
    elif a<b:
        print("No")
        continue
    g=math.gcd(b,d)
    h=int((b-1-1)/g)*g
    if a%b+h>c:
        print("No")
        continue
    print("Yes")