from fractions import gcd
t = int(input())
ans = ['Yes']*t
for i in range(t):
    a,b,c,d = map(int,input().split())
    if d < b:
        ans[i] = 'No'
    elif a < b:
        ans[i] = 'No'
    elif d == b:
        if c < a%b < b:
            ans[i] = 'No'
    else:
        if (1+(c-a%b)//(d-b))*(d-b) < b-a%b:
            ans[i] = 'No'
print("\n".join(ans))
