def gcd(m, n):
    return m if n == 1 else gcd(n, m % n)


def judge(a, b, c, d):
    if a < b or b > d:
        return False

    else:
        m = a - (a // b) * b

        if m > c:
            return False

        else:
            if b == d:
                return True
            else:
                i = m // gcd(d - b, b)
                m = (d - b) * (1 + c // (d - b))
                for j in range((b - m) // i):
                    m += i
                    if m < b:
                        return False
                    else:
                        return True




def run():
    T = int(input())

    for _ in range(T):
        A, B, C, D = (int(x) for x in input().split())

        if judge(A, B, C, D):
            print("Yes")
        else:
            print("No")

if __name__ == '__main__':
    run()