T = gets.to_i
T.times do
    a, b, c, d = gets.split.map(&:to_i)
    if a < b || b > d
        puts 'No'
    else
        gcd = b.gcd(d)
        rem = a % gcd
        min = (c-rem)/gcd*gcd + gcd + rest
        puts min >= b ? 'Yes' : 'No'
    end
end