T=int(input())
for _ in range(T):
    a,b,c,d=map(int, input().split())
    switch=0
    n=a-b
    while True:
        if n<0:
            print("No")
            break
        elif n==a-b and switch==1:
            print("Yes")
            break
        else:
            if n<=c: n = n+d-b
            else: n = n-b
            switch=1