# cook your dish here
#import numpy as np
t =int(input())

for i in range(0,t):
    a,b,c,d = map(int,input().split())
    
    l = [a]
    if a < b:
        print('No')
    elif a-c <= 0:
        if a >= b and d >=b:
            print('Yes')
        else:
            print('No')
    else:
        
        for j in range(0,100001):
            if a-c <= 0:
                if a >= b and d >=b:
                    print('Yes')
                else:
                    print('No')
                break
            if (a-c)%b == 0:
                n = (a-c)//b
            else:
                n = (a-c)//b + 1
            if a- n*b < 0:
                print('No')
                break
            if  a-n*b+d in l:
                print('Yes')
                break
            l.append(a-n*b+d)
            a = a-n*b+d
            if j == 100000:
                print('Yes')
                break