#!/usr/bin/python2
# -*- coding: utf-8 -*-

import sys
from fractions import gcd

def rl(proc=None):
    if proc is not None:
        return proc(sys.stdin.readline())
    else:
        return sys.stdin.readline().rstrip()

def srl(proc=None):
    if proc is not None:
        return map(proc, rl().split())
    else:
        return rl().split()

def solve(A, B, C, D):
    if B > A:
        return False
    if B > D:
        return False
    if B <= C+1:
        return True
    A %= B
    #if A > C:
    #    return False
    g = gcd(B, D)
    k = (B-A) / g - 1
    if (B-A) % g:
        k += 1
    return A + k * g <= C


def main():
    T = rl(int)
    for t in xrange(1, T+1):
        A, B, C, D = srl(int)
        print "Yes" if solve(A, B, C, D) else "No"

if __name__ == '__main__':
    main()
