from math import ceil
t = int(input())

for i in range(t):
    a,b,c,d = map(int, input().split())

    if a < b:
        print('No')
        continue

    if d >= b and c+1 >= b:
        print('Yes')
        continue

    A = set([a])
    while(True):
        #print(A)
        if (a-c)%b == 0:
            x = (a-c)//b
        else:
            x = ceil((a-c)/b)
        if a-b*x < 0:
            #print('No1')
            print('No')
            break
        next_a = a-b*x+d
        #print(next_a)
        if next_a < b:
            #print('No2')
            print('No')
            break
        if next_a in A:
            print('Yes')
            break
        A.add(next_a)
        if len(A) >= d:
            #print('No3')
            print('No')
            break
        a = next_a
