def canbuy(A,B,C,D):
    X=A
    for i in range(10**4):
        X-=B*max([(X-C)//B,1])
        if X<0:
            return False
        if X<=C:
            X+=D
        if X==A:
            return True
    return True
T=int(input())
a=[0 for i in range(T)]
b=[0 for i in range(T)]
c=[0 for i in range(T)]
d=[0 for i in range(T)]
for i in range(T):
    a[i],b[i],c[i],d[i]=map(int,input().split())

for i in range(T):
    if canbuy(a[i],b[i],c[i],d[i]):
        print("Yes")
    else:
        print("No")
