t = gets.chomp.to_i
abcd = []
t.times do
  abcd.push gets.split.map(&:to_i)
end
abcd.each do |e|
  a,b,c,d = e
  if b - 1 <= c && b <= a && b <= d
    puts 'Yes'
  elsif a < b
    puts 'No'
  else
    h = {}
    loop do
      # if h[a] && b <= a
      if h[a]
        puts 'Yes'
        break
      else
        h[a] = true
        mod = a % b
        if c < mod || a < b
          puts 'No'
          break
        else
          a = mod + d
          if a < b
            puts 'No'
            break
          end
        end
      end
    end
  end
end
