t = int(raw_input())
for _ in xrange(t):
    a,b,c,d = map(int, raw_input().strip().split())
    if (a<b):
        print "No"
    else:
        val = a-b
        x = c-val
        y = b-val
        #print x,y
        #if b==d:
            #if val >= 0 and val<=c:
                #print "Yes"
            #else:
                #print "No"
        # if >x and <y
        xx = d-b
        if xx<0:
            print "No"
        else:
            m = xx
            if xx==0:
                if val<=c:
                    print "Yes"
                else:
                    print "No"
            else:
                q = x / (xx)
                #print xx,q
                xx *= q
                xx+=m
                if xx < y:
                    print "No"
                else:
                    print "Yes"