/// Thank you tanakh!!!
/// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
fn gcd(a: i64, b: i64) -> i64 {
    if b == 0 {
        a
    } else {
        gcd(b, a % b)
    }
}

fn solve(a: i64, b: i64, c: i64, d: i64) -> bool {
    // c < a + bx + dy < b
    // c-a < bx + dy < b-a
    if d < b {
        false
    } else if c >= b {
        true
    } else {
        let lower = c - a;
        let upper = b - a;
        assert!(lower < upper);

        let g = gcd(b, d);
        if upper <= 0 {
            let (lower, upper) = (-upper, -lower);
            let next_g = (lower + g) / g * g;
            assert!(next_g > lower);
            assert!(next_g - g <= lower);
            if upper > next_g {
                false
            } else {
                true
            }
        } else if lower >= 0 {
            let next_g = (lower + g) / g * g;
            assert!(next_g > lower);
            assert!(next_g - g <= lower);
            if upper > next_g {
                false
            } else {
                true
            }
        } else {
            assert!(lower < 0);
            assert!(upper > 0);
            false
        }
    }
}

fn main() {
    input!(t: usize, abcd: [(i64, i64, i64, i64); t]);
    for &(a, b, c, d) in abcd.iter() {
        if solve(a, b, c, d) {
            println!("Yes");
        } else {
            println!("No");
        }
    }
}
