#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from math import ceil

def solve(A, B, C, D):
    zaiko = A
    visited = set([zaiko])
    while zaiko >= B:
        zaiko -= B
        if zaiko > C:
            zaiko -= ceil((zaiko - C) / B) * B
            if zaiko < 0 or zaiko > C: return False
        zaiko += D
        if zaiko in visited: return True
        visited.add(zaiko)
    return False


T = int(input())
for i in range(T):
    A, B, C, D = [int(t) for t in input().split()]
    print('Yes' if solve(A, B, C, D) else 'No')