import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    t = I()
    A = []
    for _ in range(t):
        a, b, c, d = LI()
        if a < b:
            ans = 'No'
        elif b > d:
            ans = 'No'
        elif c >= b:
            ans = 'Yes'
        else:
            if a % b + d < b:
                ans = 'No'
                A.append(ans)
                continue
            if d % b > 0:
                shou = (c - a % b) // (d % b)
            else:
                shou = 0
            # print()
            # print(a, b, c,d)
            # print('shou: ', shou)
            # print('d % b: ', d % b)
            # print('a % b: ', a % b)
            if c < shou * (d % b) + a % b + (d % b) < b:
                ans = 'No'
            else:
                ans = 'Yes'
            # print()
        A.append(ans)
    for a in A:
        print(a)
main()

