def judge(a,b,c,d):
    #calc border
    if a-c<0:
        border = 0
    else:
        if (a-c)%b == 0:
            border = int((a-c)/b)
        else:           
            border = int((a-c)/b)+1

    start = a-border*b

    return start
    
def check(a,b,c,d):
    if a-b<0:
        return False
    if d<b:
        return False
    
    ans = judge(a,b,c,d)
    b_list = []
    while not ans in b_list:
        b_list.append(ans)
        if ans <= c:
            a = ans+d
        else:
            a = ans
        if a-b<0:
            return False

        ans = judge(a,b,c,d)
        if ans < 0:
            return False
    
    return True
 

N = int(input())
ABCD = []
for i in range(N):
    ABCD.append(map(int, input().split()))



for a,b,c,d in ABCD:
    if check(a,b,c,d):
        print("Yes")
    else:
        print("No")