
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{VecDeque, HashSet, BTreeSet, BinaryHeap, HashMap};
#[allow(unused_imports)]
use std::io::{stdin, stdout, Write};


fn main() {
    let t: usize = read();
    let query = read_matrix::<i64>();

    let mut history: HashMap<(i64, i64, i64), i64> = HashMap::new();
    for i in 0..t {
        let (mut a, b, c, d) = (query[i][0], query[i][1], query[i][2], query[i][3]);
        if let Some(&i) = history.get(&(a, b, d)) {
            if i <= c {
                println!("Yes");
                continue;
            }
        }
        let a0 = a;
        loop {
            if a < b {
                println!("No");
                break;
            } else if c >= b && d >= c {
                println!("Yes");
                break;
            } else if a > c && (a - c) % b == 0 {
                if d % b == 0 {
                    println!("Yes");
                    break;
                }
                a = c + d;
            } else {
                let n = max(0, (a - c) / b);
                if a > a0 && (a - a0) % b == 0 {
                    println!("Yes");
                    break;
                } else if a - b * (n + 1) < 0 {
                    println!("No");
                    break;
                } else {
                    a = a - b * (n + 1) + d;
                    if a < c {
                        if b > d {
                            println!("No");
                            break;
                        } else if b < d {
                            if a0 > a && (a0 - a) % (d - b) == 0 {
                                println!("Yes");
                                break;
                            }
                            a = a + ((c - a) / (d - b)) * (d - b);
                        } else {
                            println!("Yes");
                            break;
                        }
                    }
                }
            }
            if a == a0 {
                println!("Yes");
                break;
            }
        }
        history.insert((a, b, d), c);
    }
}

#[allow(dead_code)]
fn read<T>() -> T where T: std::str::FromStr, T::Err: std::fmt::Debug {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    return buf
        .trim()
        .parse()
        .unwrap();
}

#[allow(dead_code)]
fn read_vector<T>() -> Vec<T> where T: std::str::FromStr, T::Err: std::fmt::Debug {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    return buf
        .split_whitespace()
        .map(|s| s.parse().unwrap())
        .collect();
}

#[allow(dead_code)]
fn read_matrix<T>() -> Vec<Vec<T>> where T: std::str::FromStr, T::Err: std::fmt::Debug {
    use std::io::prelude::*;
    let stdin = stdin();
    return stdin
        .lock()
        .lines()
        .map(|line| line
            .unwrap()
            .split_whitespace()
            .map(|s| s.parse().unwrap())
            .collect())
        .collect();
}