use std::io;
use std::io::{BufRead, Write};

fn solve<R: BufRead, W: Write>(mut input: R, mut output: W) {
    let mut buf = String::new();
    input.read_line(&mut buf).unwrap();
    let n: usize = buf.trim_right().parse().unwrap();
    for _ in 0..n {
        buf.clear();
        input.read_line(&mut buf).unwrap();
        let mut split = buf.split_whitespace();
        let (a, b, c, d): (usize, usize, usize, usize) = (
            split.next().unwrap().parse().unwrap(),
            split.next().unwrap().parse().unwrap(),
            split.next().unwrap().parse().unwrap(),
            split.next().unwrap().parse().unwrap(),
        );
        let possible = if a < b {
            false
        } else if d < b {
            false
        } else if c >= b {
            true
        } else {
            let initial = a % b;
            let grow = d % b;
            if c < initial {
                false
            } else if grow == 0 {
                true
            } else if (b - initial - 1) / grow > (c - initial) / grow {
                false
            } else {
                true
            }
        };
        writeln!(output, "{}", if possible { "Yes" } else { "No" }).unwrap();
    }
}

fn main() {
    let stdin = io::stdin();
    let stdout = io::stdout();
    solve(stdin.lock(), stdout.lock());
}

#[cfg(test)]
mod tests {
    fn test(input: &str, output: &str) {
        let mut v: Vec<u8> = Vec::new();
        ::solve(input.as_bytes(), &mut v);
        assert_eq!(String::from_utf8(v).unwrap(), output);
    }

    #[test]
    fn case1() {
        test(
            "14
9 7 5 9
9 7 6 9
14 10 7 12
14 10 8 12
14 10 9 12
14 10 7 11
14 10 8 11
14 10 9 11
9 10 5 10
10 10 5 10
11 10 5 10
16 10 5 10
1000000000000000000 17 14 999999999999999985
1000000000000000000 17 15 999999999999999985
",
            "No
Yes
No
Yes
Yes
No
No
Yes
No
Yes
Yes
No
No
Yes
",
        );
    }

    #[test]
    fn case2() {
        test(
            "24
1 2 3 4
1 2 4 3
1 3 2 4
1 3 4 2
1 4 2 3
1 4 3 2
2 1 3 4
2 1 4 3
2 3 1 4
2 3 4 1
2 4 1 3
2 4 3 1
3 1 2 4
3 1 4 2
3 2 1 4
3 2 4 1
3 4 1 2
3 4 2 1
4 1 2 3
4 1 3 2
4 2 1 3
4 2 3 1
4 3 1 2
4 3 2 1
",
            "No
No
No
No
No
No
Yes
Yes
No
No
No
No
Yes
Yes
Yes
No
No
No
Yes
Yes
Yes
No
No
No
",
        );
    }
}
