T = int(input())

counT = 0

def main():
    a = list(map(int,input().split()))
    A = a[0]
    B = a[1]
    C = a[2]
    D = a[3]

    #print(A,B,C,D)
    if A < B:
        return 0

    if B <= C and B <= D:
        return 1
    
    if B > D:
        return 0

    A = A % B

    count = 0

    while A  <  B:
        count += 1
        #print(A)
        if A > C and A < B:
            return 0
        if B==D:
            return 1
        #print(A,B,C,D)
        #print(int((C-A) / (D-B) + 1),count)
        if A < C:
            A += int((C-A) / (D-B) + 1) *(D-B)
            if int((C-A) / (D-B)) == 1:
                A = A - (D-B)
        else:
            A += (D-B)
    return 1




while counT < T:
    if main() == 1:
        s = "Yes"
    else:
        s = "No"
    print(s)
    counT +=1
