#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:
        if c >= b:
            print("Yes")
        else:
            uni = d//b
            sur = a % b
            while sur != a:
                if (a-d) % b > a % b:
                    a += uni * d
                else:
                    a += d
                if c < a % b:
                    print("No")
                    break
                a %= b
            else:
                print("Yes")
    