def main():
    def gcd(x, y):
        while y:
            y, x = x % y, y
        return x
    t = int(input())
    for _ in range(t):
        A, B, C, D = map(int, input().split())
        gcf = gcd(gcd(A, B), gcd(C, D))
        A, B, C, D = A // gcf, B // gcf, C // gcf, D // gcf
        if B > D or B > A or (D > B and B > C + 1 and D % B) or (A % B > C and C < B):
            print("NO")
            continue
        print("YES")
    return 0
main()