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 = mem1
    cnt = 0
    while 1 :
        if c[i][0] < c[i][1]:
            print("No")
            break; 
        if c[i][3] < c[i][1]:
            print("No")
            break;            
        if cnt == c[i][1]:
            print("Yes")
            break;
        if c[i][2] < mem1 < c[i][1]:
            print("No")
            break;    
        cnt += 1
        mem1 += mem2 
        if mem1 == mem3:
            print("Yes")
            break;