T = int(input())
a = []
for i in range(T):
    a.append(list(map(int, input().split())))
for r in a:
    s, b, c, d = r[0], r[1], r[2], r[3]
    s_list = []
    while True:
        if (s < b) or (b>d):
            print('No')
            break
        if (c>s):
            print('Yes')
        s = s%b
        s_list.append(s)
        if c < s < b:
            print('No')
            break

        s = s+d
        if s in s_list:
            print('Yes')
            break
        s_list.append(s)
