
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'
    a %= b
    s = set()
    while a not in s:
        s.add(a)
        a = (a + d) % b
        if a > c:
            return 'No'
    return 'Yes'


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


if __name__ == '__main__':
    main()
