t = int(input())
for i in range(t):
    a,b,c,d = map(int,input().split())
    dx = d%b
    if c>=b:
        print('Yes')
    elif a%b>c:
        print('No')
    elif dx==0:
        print('Yes')
    else:
        n = (c-a%b)//dx
        if a%b + dx*(n+1) <b:
            print('No')
        else:
            print('Yes')
