#[allow(unused_imports)]
use std::cmp::{min,max};
#[allow(unused_imports)]
use std::collections::BTreeMap;
#[allow(unused_imports)]
use std::ops::*;
#[allow(unused_imports)]
use std::collections::BinaryHeap;

fn gcd(x: i64, y: i64) -> i64 {
    if y == 0 {
        x
    }
    else {
        gcd(y, x%y)
    }
}

fn sim(a: i64, b: i64, c: i64, d: i64) -> bool {
    unimplemented!();
}

fn main() {
    let n = read_i64() as usize;
    for _ in 0..n {
        let (a,b,c,d) = {
            let xs = read_vec_i64();
            (xs[0], xs[1], xs[2], xs[3])
        };
        let res = if a < b {
            false
        }
        else if b > d {
            false
        }
        else if b <= c && b <= d {
            true
        }
        else if c < b && b == d {
            0 <= a % b && a % b <= c
        }
        else if c + 1 == b && b < d {
            true
        }
        else if c < b && b < d {
            //println!("c={}, a-b={}, d-b={}, b={}, a%b={}", c, a-b, d-b, b, a%b);
            //println!("??={}", (c-((d%b)-b)+10*b)%b);
            //let t = ((b-a%b/(d-b)*(d-b))%b;
            //println!("t={}", t);
            if a%b < c && (b-1-a%b)/(d-b) != (c-a%b)/(d-b) {
                false
            }
            else {
                0 <= a % b && a % b <= c
            }
        }
        else {
            unreachable!();
        };
        println!("{}", if res { "Yes" } else { "No" });
        //println!();
    }
}

#[allow(dead_code)]
fn read_line() -> String {
    let mut ret = String::new();
    std::io::stdin().read_line(&mut ret).ok();
    ret.pop();
    return ret;
}

#[allow(dead_code)]
fn read_i64() -> i64 {
    let ss = read_line();
    return ss.parse::<i64>().unwrap();
}

#[allow(dead_code)]
fn read_vec_i64() -> Vec<i64> {
    let mut res = vec![];
    let ss = read_line();
    for ts in ss.split_whitespace() {
        let x = ts.parse::<i64>().unwrap();
        res.push(x);
    }
    return res;
}

use std::fmt::Display;
#[allow(dead_code)]
fn write_vec<T: Display>(xs: &Vec<T>) {
    if xs.len() == 0 {
        println!("");
        return;
    }
    print!("{}", xs[0]);
    for i in 1..xs.len() {
        print!(" {}", xs[i]);
    }
    println!("");
}
