from math import floor
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)
T = int(input())
for i in range(T):
    A,B,C,D = map(int,input().split())
    if B > D:
        print("No")
    else:
        if A%B>C:
            print("No")
        else:
            d = gcd(B,D%B)
            r = A%B
            if r%d == 0:
                if B-D > C:
                    print("No")
                else:
                    print("Yes")
            else:
                if r+floor((B-r)/d) > C:
                    print("No")
                else:
                    print("Yes")