T = int(input())
for i in range(T):
    a, b, c, d = map(int, input().split())
    current = a
    flag = True
    memo =[]
    if b > c:
        while(1):
            #print(current)
            if current < b:
                flag = False
                break
            current %= b
            #print(current)
            if current <= c:
                current += d
            if current in memo:
                break
            memo.append(current)
    print("Yes" if flag == True else "No")
