from collections import defaultdict
t=int(input())
for _ in range(t):
    memo=defaultdict(int)
    a,b,c,d=map(int,input().split())
    if b>d or a<b:
        print("No")
    else:
        cur=a
        while True:
            if cur<c:
                cur-=b
            elif (cur-c)%b==0:
                cur=c
            else:
                cur=cur-((cur-c)//b)*b-b
            if cur<0:
                print("No")
                break
            if memo[cur]==0:
                memo[cur]+=1
            else:
                print("Yes")
                break
            if cur<=c:
                cur+=d
