import math
t = int(input())
abcd_list = [[int(i) for i in input().split()] for _ in range(t)]

for i in range(len(abcd_list)):
    a, b, c, d = abcd_list[i]
    _a = a
    is_ok = True
    for j in range(10000):
        if b > a:
            is_ok = False
            break
        if b > d:
            is_ok = False
            break
        if c > b:
            is_ok = True
            break
        g = math.gcd(b, d)
        max_mod_b = b - g + a & g
        if max_mod_b > c:
            print('Yes')
        else:
            print('No')
