import math
# 最小公倍数
def lcm(a, b):
    return a * b // math.gcd(a, b)

t = int(input())
c = [list(map(int,input().split())) for i in range(t)]
for i in range(t):
    mem1 = c[i][0] % c[i][1]
    mem2 = c[i][3] % c[i][1]
    mem3 = (c[i][1]-1) % lcm(c[i][1],c[i][3])
    while 1 :
        if c[i][0] < c[i][1]:
            print("No")
            break; 
        elif c[i][3] < c[i][1]:
            print("No")
            break;      
        elif mem2 == 0 :
            if c[i][1] - c[i][2] > 1 and c[i][2] < mem1 < c[i][1]:
                print("No")    
                break;
            else :
                print("Yes")
                break;
        elif c[i][1] - c[i][2] == 1 :
            print("Yes")
            break;
        elif  mem3 < mem1 + c[i][1] - c[i][2]:
            print("No")
            break;
        elif mem2 % 2 == 1 and c[i][1] - c[i][2] > 1:
            print("No")  
            break;          
        else :
            print("Yes")
            break;   
