
def gcd(a, b):
    if a < b:
        b, a = a, b
    while b:
        a, b = b, a % b
    return a


def calc():
    a, b, c, d = map(int, raw_input().split())
    if a < b:
        return 'No'
    if d < b:
        return 'No'
    if c >= b:
        return 'Yes'
    g = gcd(b, d)
    a %= b
    n = (b - a) / g
    if a + g * n == b:
        n -= 1
    if a + g * n > c:
        return 'No'
    else:
        return 'Yes'


def main():
    t = input()
    for _ in range(t):
        print calc()


if __name__ == '__main__':
    main()
