import math
n = int(input())
for i in range(n):
    a,b,c,d = map(int,input().split())
    if a < b:
        print("No")
    elif b > d:
        print("No")
    elif c >= b:
        print("Yes")
    else:
        g = math.gcd(b,d)
        if b-g+(a%g) > c:
            print("No")
        else:
            print("Yes")