T = int(input())
for t in range(T):
    [a, b, c, d] = list(map(int, input().split()))
    if (a < b):
        print("No")
        continue
    if (d < b):
        print("No")
        continue
    if (b <= c):
        print("Yes")
        continue
    if ((a % b) > c):
        print("No")
        continue
    if (d % b == 0):
        print("Yes")
        continue
    if (c == b - 1):
        print("Yes")
        continue
    if (b % (d % b) == 0):
        k = (c - (a % b)) // (d % b)
        A = a % b + (k + 1) * (d % b)
        if (A % b > c):
            print("No")
        else:
            print("Yes")
        continue
        
    k = (c - (a % b)) // (d % b)
    A = a % b + (k + 1) * (d % b)

    if (A % b > c):
        print("No")
        continue
    
    ddb = (A % b - a + b) % b
    
    k = (c - (a % b)) // ddb
    A = a % b + (k + 1) * ddb
    if (A % b > c):
        print("No")
    else:
        print("Yes")
    
