from sys import stdin

# stdin = open('sample.txt')

def spam(A, B, C, D):
    if A < B:
            print('No')
            return
    # elif B <= C:
    #     print('Yes')
    #     return

    a = A % B
    for i in range(10000):
        if a <= C:
            a += D
        if a < B:
            print('No')
            return
        a = a % B
    print('Yes')


def main():
    T = int(stdin.readline().rstrip())
    for _ in range(T):
        A, B, C, D = [int(x) for x in stdin.readline().rstrip().split()]
        spam(A, B, C, D)


if __name__ == '__main__':
    main()
