t = int(input())

for i in range(t):
    able = "Yes"
    a,b,c,d = map(int, input().split())
    x = c+(a-c)%b
    for i in range(1000):
        x-=b
        if x >= 0:
            if x <= c:
                x+=d
        else:
            able = "No"
            break
    print(able)