import math
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 = math.floor(P)
    QQ = math.floor((Q))
    if PP == QQ :
        print("Yes")
    else :
        print("No")
