use std::io::*;
use std::str::FromStr;
use utils::*;

pub fn main() {
    let i = stdin();
    let mut o = Vec::new();
    run(i.lock(), &mut o);
    stdout().write_all(&o).unwrap();
}

fn run<R: BufRead, W: Write>(i: R, o: &mut W) {
    let mut i = CpReader::new(i);
    let t = i.read::<usize>();
    for _ in 0..t {
        let (a, b, c, d) = i.read4::<usize, usize, usize, usize>();
        let result = if solve(a, b, c, d) { "Yes" } else { "No" };
        writeln!(o, "{}", result).unwrap();
    }
}
fn solve(mut a: usize, b: usize, c: usize, d: usize) -> bool {
    if a < b || d < b {
        return false;
    }
    if c >= b {
        return true;
    }
    a -= b;
    if a <= c {
        a += d;
    }
    a -= ((a - c - 1) / b) * b;
    if a < b {
        return false;
    }

    let a0 = a;
    loop {
        a -= b;
        a += d;
        a -= ((a - c - 1) / b) * b;

        if a < b {
            return false;
        }
        if a == a0 {
            return true;
        }
    }
}

mod utils {
    use super::*;

    pub struct CpReader<R: BufRead> {
        r: R,
        s: String,
    }

    macro_rules! fn_read {
        {$f:ident($($v:ident: $t:ident),*)} => {
            pub fn $f<$($t: FromStr),*>(&mut self) -> ($($t),*) {
                let i = &mut self.read_line().split(' ');
                $(
                    let $v = i.next().unwrap().parse().ok().unwrap();
                )*
                ($($v),*)
            }
        };
    }

    impl<R: BufRead> CpReader<R> {
        pub fn new(r: R) -> Self {
            CpReader {
                r: r,
                s: String::new(),
            }
        }
        pub fn read_line(&mut self) -> &str {
            self.s.clear();
            self.r.read_line(&mut self.s).unwrap();
            self.s.trim()
        }

        pub fn read<T: FromStr>(&mut self) -> T {
            self.read_line().parse().ok().unwrap()
        }
        fn_read! { read4(v1: T1, v2: T2, v3: T3, v4: T4) }
    }
}
