T = int(input())
for i in range(T):
    ans = "Yes"
    a, b, c, d = map(int, input().split())
    if b > a or b > d:
        ans = "No"
    hoge = []
    while(len(hoge) == len(set(hoge))):
        a = a % b
        if a > c:
            ans = "No"
            break
        a += d
        hoge.append(a)
    print(ans)