#!/usr/local/bin/python
# -*- coding: utf-8 -*-


def solve(x):
    x1 = x[0]
    x2 = x[1]
    x3 = x[2]
    x4 = x[3]

    x11 = x1 % x2
    x41 = x4 % x2

    if x1 < x2:
        return False

    if x1 == x2:
        if x4 < x2:
            return False
        else:
            return True

    if x4 < x2:
        return False
    
    while True:
        a = x11 + x41
        if a == x11:
            if x11 <= x3:
                return True
            else:
                return False
        if a > x3 and a < x2:
            return False
        if a < x3 and a > x2:  
            return False
        if a >= x3 and a >= x2:
            return True
        x11 = a

num = int(input())

s = []
for i in xrange(num):
    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    q = [a, b, c, d]
    s.append(q)

for i in s:
    if solve(i):
        print "Yes"
    else:
        print "No"