require 'pp'
T = gets.to_i

def reduce(cur, b, c, d)
  if cur - b > c
    cur = cur % b
    while cur <= c
      cur += b
    end
  end
  cur
end

T.times do
  a, b, c, d = gets.split(' ').map(&:to_i)

  if b > d
    puts 'No'
    next
  end

  knowns = {} 
  knowns[a] = true

  cur = a
  cur = reduce(cur, b, c, d)

  knowns[cur] = true
  while true
    cur = reduce(cur, b, c, d) - b
    if cur < 0
      puts 'No'
      break
    end
    cur += d if cur <= c
    if knowns[cur]
      puts 'Yes'
      break
    end
    knowns[cur] = true
  end
end
