from fractions import gcd
t = int(raw_input())
for _ in xrange(t):
    a, b, c, d = map(int, raw_input().split())
    if a < b or b > d:
        print 'No'
        continue
    a -= b
    if a > c:
        a -= (a - c + b - 1) / b * b
    if a < 0:
        print 'No'
    elif d % b == 0 or c >= b:
        print 'Yes'
    else:
        d = gcd(b, d)
        a += (c - a + d) / d * d
        print 'No' if a < b else 'Yes'
