
T = int(input())
for i in range(T) :
    A,B,C,D = map(int,input().split())
    a1 = A-B
    d = D-B
    P = (C+d-a1)/d
    Q = (B+d-a1)/d
    PP = int(P)
    QQ = int(Q)
    if a1 > 0 :
        if P == PP :
            if (QQ - PP == 0) or (QQ - PP == 1) :
                print("Yes")
            else :
                print("No")
        elif QQ - PP == 0 :
            print("Yes")
        else :
            print("No")
    else :
        print("No")

