T=int(input())
for _ in range(T):
    a,b,c,d=map(int, input().split())
    if a<b or b>d or a%b>c: print("No")
    elif b<=c+1 or b==d: print("Yes")
    else:
        if int((b+c-a)/(d-b)) == int((2*b-a)/(d-b)):
            print("Yes")
        else: print("No")