T = int(input())
queries = [list(map(int, input().split())) for _ in range(T)]

for query in queries:
    init = query[0] - query[1]
    d = query[3] - query[1]

    if init < 0:
        print('No')
        continue
    if d < 0:
        print('No')
        continue

    # for th
    if d == 0:
        if init > query[2]:
            if init >= query[1]:
                print('Yes')
            else:
                print('No')
        else:
            if init + query[3] >= query[1]:
                print('Yes')
            else:
                print('No')
    else:
        th = d * ((query[2] - init) // d) + d
        if th + init >= query[1]:
            print('Yes')
        else:
            print('No')