use std::collections::HashMap;
fn main() {
    let t: u64 = read();
    for i in 0..t{
        let mut a:u64 = read();
        let b:u64 = read();
        let c:u64 = read();
        let mut d:u64 = read();
        let mut temp = a % b;
        let mut map: HashMap<u64, u64> = HashMap::new();
        loop {
            if a < b {
                println!("{}", "No");
                break;
            }
            a = a % b;
            if a > c {
                println!("{}", "No");
                break;
            }
            a = a + d;
            if a < b {
                println!("{}", "No");
                break;
            }
            if map.contains_key(&a) {
                println!("{}", "Yes");
                break;
            }
            map.insert(a, 1);
        }
    };
}
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char) 
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}