def hantei(a, b, c, d):
    z = a
    while True:
        zz = z
        if z < b:
            return False
        if z - b > c:
            z = (z - c) % b + c
        else:
            z -= b
        if z <= c:
            z += d
        if z == a or z == zz:
            return True

t = int(input())
for i in range(t):
    query = map(int, input().split())
    print("Yes" if hantei(*query) else "No")