t = int(input())
matrix = []
for i in range(t):
    matrix.append([int(i) for i in input().split()])

for row in matrix:
    a, b, c, d = row
    bc_diff = b - c
    if not False in [i % bc_diff == 0 for i in row]:
        a, b, c, d = [i // bc_diff for i in row]

    if a < b:
        print('No')
    elif a % b > c:
        print('No')
    elif b == d:
        if a % b <= c:
            print('Yes')
        else:
            print('No')
    elif b == c:
        if b <= (d - 1):
            print('Yes')
        else:
            print('No')
    elif b < c:
        if b > d:
            print('No')
        else:
            print('Yes')
    elif (b - c) == 1:
        if b <= d:
            print('Yes')
        else:
            print('No')
    elif (b - c) >= (d - b):
        print('No')
    else:
        print('Yes')
