import math
t = int(input())
for i in range(t):
  a,b,c,d = [int(x) for x in input().split()]
  if a < b or b > d:
    print("No")
    continue
  elif b == d:
    if a%b <= c:
      print("Yes")
    else:
      print("No")
    continue
  else:
    if b <= c:
      print("Yes")
      continue
    else:
      l =[]
      tmp = a
      buf = math.ceil(c/b)*b-b
      first = tmp % b + buf
      second = first % b + buf
      if first > c or second > c:
        print("No")
      if first == second:
        print("Yes")
      else:
        dif = second -first
        if (c - first)%dif == 0:
          print("YES")
        else:
          print("No")
