import math
n=int(input())
for i in range(n):
    a,b,c,d=map(int,input().split())
    if(b>a or b>d):
        print("No")
        continue
    if(b<=c):
        print("Yes")
        continue
    if(b-math.gcd(b,d)+a%math.gcd(b,d)<=c):print("Yes")
    else:print("No")

