def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

T = int(raw_input())

for i in range(T):
    A,B,C,D = map(int,raw_input().split())
    if A<B:
        print 'No'
    elif B>D:
        print 'No'
    elif C>=B:
        print 'Yes'
    else:
        if A%B>C:
            print 'No'
        elif D%B==0:
            print 'Yes'
        elif gcd(D%B,B)>=B-C and ( (B-A%B)%(D%B)>=B-C or (B-A%B)%(D%B)==0):
            print 'Yes'
        else:
            print 'No'
        