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 map: HashMap<u64, u64> = HashMap::new();
        if a < b {
            println!("{}", "No");
        }else if d < b {
            println!("{}", "No");
        }else{
            a = a % b;
            d = d % b;
            loop {
                a = a % b;
                if a > c {
                    println!("{}", "No");
                    break;
                }
                a = a + d;
                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")
}