#!/usr/bin/env python


def min_an(_, b, c, d):
    a = 0

    if b % (d - b) == 0:
        return (a % (d - b)) + (int(b / (d - b)) - 1) * (d - b)
    else:
        return (a % (d - b)) + int(b / (d - b)) * (d - b)


n = int(input().strip())

an = []
bn = []
cn = []
dn = []

for _ in range(n):
    a, b, c, d = map(int, input().strip().split(' '))
    an.append(a)
    bn.append(b)
    cn.append(c)
    dn.append(d)

for i in range(n):
    a, b, c, d = an[i], bn[i], cn[i], dn[i]

    if b == d:
        if a == b:
            print('Yes')
        else:
            print('No')
    else:
        if min_an(a, b, c, d) + b <= (b + c):
            print('Yes')
        else:
            print('No')
