#coding:utf-8
import math
gcd = math.gcd

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:
            success = 0
            if gcd(a,d) == 1:
                print("No")
                success = 1
            if success == 0:

                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")
        


        
