n = int(input())
list = [map(int, input().split()) for i in range(n)]

def check(num):
    a, b, c, d = list[num]
    if b > d:
        return False
    if a < b:
        return False
    if a % b > c:
        return False
    if c < b and d > b:
        if (b - ( a % b ) - 1) // (d - b) != (c - ( a % b )) // (d - b):
            return False
    return True

for i in range(n):
    if check(i):
        print('Yes')
    else:
        print('No')