#!/usr/bin/env python
# coding: utf-8
#


def main_func(input_str):
    l = list(map(int, input_str.split(' ')))
    a = l[0]
    b = l[1]
    c = l[2]
    d = l[3]
    # 明らかにNGケース
    if a < b:
        print('No')
        return
    elif d < b:
        print('No')
        return

    
    # 初回でNG出すケース
    count_set = {}
    amari = a % b
    for i in range(c):
        try:
            if count_set[amari] == 1:
                break
        except KeyError:
            count_set[amari] = 1
        
        if amari > c:
            print('No')
            # print(amari, b, c)
            return
        amari = (amari + d) % b

    
    print('Yes')
    return

def main(n, input_list):
    for i in range(n):
        main_func(input_list[i])

if __name__ == '__main__':
    try:
        n = int(input().strip())
        input_list = []
        for i in range(n):
            input_list.append(input().strip())
        main(n, input_list)
    except EOFError:
        pass
