#coding:utf-8
T = int(input())
for i in range(T):
    a,b,c,d = map(int,input().split())
    if b > d:
        print("No")
    elif a < b:
        print("No")
    else:
        sur = a % b
        while sur != a:
            a += d
            if c < a % b:
                print("No")
                break
            a %= b
        else:
            print("Yes")
    
