#[allow(unused_macros)]
macro_rules! parse_line {
    ( $t:ty ) => (
        {
            let mut line = String::new();
            ::std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            iter.next().unwrap().parse::<$t>().unwrap()
        }
    );

    ( $( $t:ty), +) => (
        {
            let mut line = String::new();
            ::std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            ( $(iter.next().unwrap().parse::<$t>().unwrap()),* )
        }
    );
}

#[allow(unused_macros)]
macro_rules! read_line {
    () => (
        {
            let mut line = String::new();
            ::std::io::stdin().read_line(&mut line).unwrap();
            line.pop();
            line
        }
    )
}

#[allow(unused_macros)]
macro_rules! parse_vec {
    ( $t:ty ) => (
        {
            let mut line = String::new();
            ::std::io::stdin().read_line(&mut line).unwrap();
            let iter = line.split_whitespace();
            iter.map(|v| v.parse::<$t>().unwrap()).collect::<Vec<_>>()
        }
    )
}

fn solve(a: u64, b: u64, c: u64, d: u64) -> bool {
    use std::collections::HashMap;

    if a < b {
        return false
    }

    if d < b {
        return false
    }

    if b-1 <= c {
        return true
    }

    let mut m = HashMap::new();
    m.insert(a, true);

    let mut na = a;

    let dmodb = if d % b == 0 { d } else {d % b};
    let mut r = na % b;

    while true {
        if r > c {
            return false
        }

        let na = c + (((c - r) / dmodb ) + 1) * dmodb;
        if na > c && na < b {
            return false
        }
        if m.contains_key(&na) {
            return true
        }

        m.insert(na, true);
        r = na % b;
    }

    unreachable!()
}

fn main() {
    let n = parse_line!(usize);
    let mut ss = Vec::new();

    for _ in 0..n {
        ss.push(parse_vec!(u64));
    }

    for v in ss {
        println!("{}", if solve(v[0], v[1], v[2], v[3]) { "Yes" } else { "No" });
    }
}

#[test]
fn solve_test() {
    assert_eq!(solve(7,7,5,7), true);
    assert_eq!(solve(13,7,5,7), false);
    assert_eq!(solve(7,2,1,3), true);
    assert_eq!(solve(1000000000000000000, 17, 14, 999999999999999985), false);
    assert_eq!(solve(1000000000000000000, 17, 15, 999999999999999985), true);
}
